JDialogs vs JFrames behaviours [message #4888] |
Tue, 25 November 2003 01:35  |
Eclipse User |
|
|
|
Hello!
I observed a different behavior to JFrame and JDialog.
When I create a JFrame and I open it with the VE, an empty
Window appears. If I put a JPanel in the JFrame this JPanel
is treated as the ContentPane. And I can add my components
into this JPanel.
When I create a JDialog and I open it with the VE, an empty
Window appears. If I put a JPanel in the JDialog an error
appears: "components: java.lang.Error (Do not use
javax.swing.JDialog.add()
use javax.swing.jDialog.getContentPane().add() instead)".
So, if I add a first JPanel to an empty JFrame this JPanel is treated
as the Content Pane. If I do the same with a JDialog, no.
Well, but If I use the "New Visual Class" pop-up menu?
If I create a JFrame (I select "Frame" and "Swing"), an empty
Window appears but with a size and a ContentPane and a getContentPane()
method created.
If I create a JDialog (I select "Other", "Swing" and "JDialog")
[I think if JFrame haves a Radio Button in the wizard, then
JDialog must have another Radio Button. A JFrame based application
usually haves JDialogs]. An empty sized Window appears and an empty
JPanel outside the Window. It seems this JPanel is the Content Pane
for the Dialog. This JPanel appears without size. I must resize it
to add the components. If I add components into this JPanel, the
Window stays inalterable. The new components I added are only showed
into the JPanel.
Now, I drag the Content Pane into the JDialog. An error appears:
"components: java.lang.Error (Do not use javax.swing.JDialog.add()
use javax.swing.jDialog.getContentPane().add() instead)". Well, I undo
the add() and now I have a copy of the Content Pane in my JDialog!
Now I resize the Window/JDialog. The JPanel is resized and the
Window/JDialog don't shows the components of JPanel/ContentPane
any more.
Conclusion: IMHO I'm unable to develop a JDialog in a normal
manner. I think there is no reason to maintain two behaviours.
A JDialog must be the same bahaviour of a JFrame.
Francesc Rosés
|
|
|
|
Re: JDialogs vs JFrames behaviours [message #5525 is a reply to message #5294] |
Tue, 25 November 2003 14:05  |
Eclipse User |
|
|
|
Peter,
Thanks a lot! Exactly there is an XML syntax error (JEdit indicates
the error...!). I modified the JDialog.override and all works!
Francesc
Peter Walker wrote:
> Francesc,
> Thanks for finding and reporting this problem. I opened bug 47421 to track
> this and I found the cause of the problem which is easy to fix. I'll release
> the fix for the next build (RC2).
> For now until the fix is available in the next build (which probably won't
> be out until after the US thanksgiving holiday) you can easily fix this
> yourself since it's not code and is just and xmi file change. Here's how:
> Edit (with Wordpro or Notepad) the file JDialog.override located in
> YOUR_INSTALL_DIReclipsepluginsorg.eclipse.ve.jfc_0.5.0overri desjavaxsw
> ing. Line 17 the statement says:
> </event:Add>
> Change it to:
> </event:AddMany>
> Save the file and restart Eclipse. (If you already have the project open,
> just close and reopen the project and the settings will be recached). The
> JDialog class should come up correctly with the contentpane on the JDialog.
> Note: I wouldn't recommend editing these files in the future since these are
> the xmi files that are used to decorate the AWT/Swing classes with specific
> overrides needed for the classes to work correctly in VE.
> Regards...
> Peter Walker
> "Francesc Rosés" <froses@menta.net> wrote in message
> news:bput6q$dsj$1@eclipse.org...
> > Hello!
> >
> > I observed a different behavior to JFrame and JDialog.
> >
> > When I create a JFrame and I open it with the VE, an empty
> > Window appears. If I put a JPanel in the JFrame this JPanel
> > is treated as the ContentPane. And I can add my components
> > into this JPanel.
> >
> > When I create a JDialog and I open it with the VE, an empty
> > Window appears. If I put a JPanel in the JDialog an error
> > appears: "components: java.lang.Error (Do not use
> > javax.swing.JDialog.add()
> > use javax.swing.jDialog.getContentPane().add() instead)".
> >
> > So, if I add a first JPanel to an empty JFrame this JPanel is treated
> > as the Content Pane. If I do the same with a JDialog, no.
> >
> > Well, but If I use the "New Visual Class" pop-up menu?
> >
> > If I create a JFrame (I select "Frame" and "Swing"), an empty
> > Window appears but with a size and a ContentPane and a getContentPane()
> > method created.
> >
> > If I create a JDialog (I select "Other", "Swing" and "JDialog")
> > [I think if JFrame haves a Radio Button in the wizard, then
> > JDialog must have another Radio Button. A JFrame based application
> > usually haves JDialogs]. An empty sized Window appears and an empty
> > JPanel outside the Window. It seems this JPanel is the Content Pane
> > for the Dialog. This JPanel appears without size. I must resize it
> > to add the components. If I add components into this JPanel, the
> > Window stays inalterable. The new components I added are only showed
> > into the JPanel.
> >
> > Now, I drag the Content Pane into the JDialog. An error appears:
> > "components: java.lang.Error (Do not use javax.swing.JDialog.add()
> > use javax.swing.jDialog.getContentPane().add() instead)". Well, I undo
> > the add() and now I have a copy of the Content Pane in my JDialog!
> >
> > Now I resize the Window/JDialog. The JPanel is resized and the
> > Window/JDialog don't shows the components of JPanel/ContentPane
> > any more.
> >
> > Conclusion: IMHO I'm unable to develop a JDialog in a normal
> > manner. I think there is no reason to maintain two behaviours.
> > A JDialog must be the same bahaviour of a JFrame.
> >
> > Francesc Rosés
> >
|
|
|
Re: JDialogs vs JFrames behaviours [message #569097 is a reply to message #4888] |
Tue, 25 November 2003 09:57  |
Eclipse User |
|
|
|
Francesc,
Thanks for finding and reporting this problem. I opened bug 47421 to track
this and I found the cause of the problem which is easy to fix. I'll release
the fix for the next build (RC2).
For now until the fix is available in the next build (which probably won't
be out until after the US thanksgiving holiday) you can easily fix this
yourself since it's not code and is just and xmi file change. Here's how:
Edit (with Wordpro or Notepad) the file JDialog.override located in
YOUR_INSTALL_DIR\eclipse\plugins\org.eclipse.ve.jfc_0.5.0\ov errides\javax\sw
ing. Line 17 the statement says:
</event:Add>
Change it to:
</event:AddMany>
Save the file and restart Eclipse. (If you already have the project open,
just close and reopen the project and the settings will be recached). The
JDialog class should come up correctly with the contentpane on the JDialog.
Note: I wouldn't recommend editing these files in the future since these are
the xmi files that are used to decorate the AWT/Swing classes with specific
overrides needed for the classes to work correctly in VE.
Regards...
Peter Walker
"Francesc Ros
|
|
|
Re: JDialogs vs JFrames behaviours [message #569157 is a reply to message #5294] |
Tue, 25 November 2003 14:05  |
Eclipse User |
|
|
|
Peter,
Thanks a lot! Exactly there is an XML syntax error (JEdit indicates
the error...!). I modified the JDialog.override and all works!
Francesc
Peter Walker wrote:
> Francesc,
> Thanks for finding and reporting this problem. I opened bug 47421 to track
> this and I found the cause of the problem which is easy to fix. I'll release
> the fix for the next build (RC2).
> For now until the fix is available in the next build (which probably won't
> be out until after the US thanksgiving holiday) you can easily fix this
> yourself since it's not code and is just and xmi file change. Here's how:
> Edit (with Wordpro or Notepad) the file JDialog.override located in
> YOUR_INSTALL_DIReclipsepluginsorg.eclipse.ve.jfc_0.5.0overri desjavaxsw
> ing. Line 17 the statement says:
> </event:Add>
> Change it to:
> </event:AddMany>
> Save the file and restart Eclipse. (If you already have the project open,
> just close and reopen the project and the settings will be recached). The
> JDialog class should come up correctly with the contentpane on the JDialog.
> Note: I wouldn't recommend editing these files in the future since these are
> the xmi files that are used to decorate the AWT/Swing classes with specific
> overrides needed for the classes to work correctly in VE.
> Regards...
> Peter Walker
> "Francesc Rosés" <froses@menta.net> wrote in message
> news:bput6q$dsj$1@eclipse.org...
> > Hello!
> >
> > I observed a different behavior to JFrame and JDialog.
> >
> > When I create a JFrame and I open it with the VE, an empty
> > Window appears. If I put a JPanel in the JFrame this JPanel
> > is treated as the ContentPane. And I can add my components
> > into this JPanel.
> >
> > When I create a JDialog and I open it with the VE, an empty
> > Window appears. If I put a JPanel in the JDialog an error
> > appears: "components: java.lang.Error (Do not use
> > javax.swing.JDialog.add()
> > use javax.swing.jDialog.getContentPane().add() instead)".
> >
> > So, if I add a first JPanel to an empty JFrame this JPanel is treated
> > as the Content Pane. If I do the same with a JDialog, no.
> >
> > Well, but If I use the "New Visual Class" pop-up menu?
> >
> > If I create a JFrame (I select "Frame" and "Swing"), an empty
> > Window appears but with a size and a ContentPane and a getContentPane()
> > method created.
> >
> > If I create a JDialog (I select "Other", "Swing" and "JDialog")
> > [I think if JFrame haves a Radio Button in the wizard, then
> > JDialog must have another Radio Button. A JFrame based application
> > usually haves JDialogs]. An empty sized Window appears and an empty
> > JPanel outside the Window. It seems this JPanel is the Content Pane
> > for the Dialog. This JPanel appears without size. I must resize it
> > to add the components. If I add components into this JPanel, the
> > Window stays inalterable. The new components I added are only showed
> > into the JPanel.
> >
> > Now, I drag the Content Pane into the JDialog. An error appears:
> > "components: java.lang.Error (Do not use javax.swing.JDialog.add()
> > use javax.swing.jDialog.getContentPane().add() instead)". Well, I undo
> > the add() and now I have a copy of the Content Pane in my JDialog!
> >
> > Now I resize the Window/JDialog. The JPanel is resized and the
> > Window/JDialog don't shows the components of JPanel/ContentPane
> > any more.
> >
> > Conclusion: IMHO I'm unable to develop a JDialog in a normal
> > manner. I think there is no reason to maintain two behaviours.
> > A JDialog must be the same bahaviour of a JFrame.
> >
> > Francesc Rosés
> >
|
|
|
Powered by
FUDForum. Page generated in 0.07405 seconds