Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Jframes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jframes" Watch "Jframes" New topic
Author

Jframes

Fran Costigan
Greenhorn

Joined: Feb 06, 2006
Posts: 8
Can you use multiple frames when creating a java GUI, and if so how do i go about doing so?
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Yes. Create a second JFrame and make it visible using setVisible(true) the same way you did the first. You can also use a JDesktopPane and multiple JInternalFrames depending on what you want to do.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Note: Use the setLocation(int x, int y) method so that the frames don't simply appear directly on top of one another.

Also, if you're interested in using JInternalFrames, see this tutorial: How to Use Internal Frames.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
jQuery in Action, 2nd edition
 
subject: Jframes
 
Similar Threads
Defect on Microsoft portal
Goods and Services Deficit Increases in March 2003
failed twice in half an hour.
error comes while connecting to database please see the source code and error for detail
Is Spring Web Services good enough?