Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BoxLayout - can't be shared run time error

807606Apr 16 2007 — edited Apr 16 2007
Hi!

I get this error:
Exception in thread "AWT-EventQueue-0" java.awt.AWTError: BoxLayout can't be shared.

I have a main panel, with all the UI components working fine. When I press a button I display a custom dialog. I try to set a JPanel as the dialog's content pane. Then I try to set up the BoxLayout as the layout manager for the JDialog.
But I get that awful error.
Can you please tell me why?
I enclose some code too:

JDialog sortDialog = new JDialog(frame, "Se sorteaza");
BoxLayout layout = new BoxLayout(sortDialog, BoxLayout.Y_AXIS);
sortDialog.setContentPane(new JPanel(layout));
sortDialog.pack();
sortDialog.setVisible(true);

Message was edited by:
nopceafrancisc
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2007
Added on Apr 16 2007
1 comment
1,129 views