PDA

View Full Version : Java GUI Help



Griff
April 3rd, 2007, 05:51 AM
I've never really done much with GUIs in general and I'm especially rusty in java. I've searched through the java docs site, but it left me a little confused with references to 'java web start' and other things. If I have a just an empty frame up, how do I add a bar at the top (like the one at the top of this browser that has pull down menus) and use a selection to bring up a save dialog box. I'm pretty sure there is an easy way to do this, but I've been struggling for a while now and would greatly appreciate some help.

Thanks,
Griff

amohanty
April 3rd, 2007, 05:54 AM
you have to add a JMenuBar and populate it with menu items.
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

HTH
AM

Griff
April 3rd, 2007, 07:12 AM
Thank you! That helped a lot. Now I just need to figure out how to bring up a file browser to select a save location.

amohanty
April 3rd, 2007, 07:14 AM
http://java.sun.com/javase/6/docs/api/javax/swing/JFileChooser.html

I would suggest browsing a swing book at the local bookstore and bookmarking the api docs :)

HTH
AM

laxmanb
April 3rd, 2007, 12:02 PM
you want to add a menu bar and a Save dialog?

Sun Java Tutorials*(JFileChooser):
http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html