Hello everyone,
The gui I have created has become too crowded with buttons and sliders
and such, so I want to move much of the control to a menu bar. I
understand how to create a menu bar, but I have a general question
about how to use the menu bar effectively. In many windows programs,
when you click on "Save As", a new window pops up containing the gui
specific to saving. This is the kind of control I want to develop;
clicking "Draw Options" from a menu bar will bring up a window with a
Scale slider, and a Rotate slider, etc.
I am thinking of doing this by having the menu bar button create a new
JPanel which contains the appropriate controls. Is this a reasonable
approach, or is there a more standard/ efficient way of creating these
kinds of control boxes? Also, are these "Save As" boxes called dialog
boxes, or something else?
Eric
BTW, I don't need any code examples, just a little perspective on which
direction to head with this. Thank you.
Natasha Lloyd - 30 Aug 2006 17:41 GMT
e_matt...@hotmail.com wrote:
> I am thinking of doing this by having the menu bar button create a new
> JPanel which contains the appropriate controls. Is this a reasonable
> approach, or is there a more standard/ efficient way of creating these
> kinds of control boxes?
A JPanel alone will not be enough. You should probably place your
controls inside a JDialog. You can read all about how to use JDialogs
here:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
.
>Also, are these "Save As" boxes called dialog
> boxes, or something else?
The "Save As..." dialog is a JFileChooser. Again, check the Java docs
for more information about it.
Hope that helps...
- Natasha -