Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jframes

 
Fran Costigan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you use multiple frames when creating a java GUI, and if so how do i go about doing so?
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!