The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


JFrame and multiple tabs

Posted by Hiran on January 28, 2002 at 9:49 PM

I have a question regarding JFrame and multiple tabs. Well...actually, it's not really multiple tabs. It's more like multiple interfaces using one JFrame. For example, I have a button that has been attached to JFrame when the application first starts. When a user clicks on the button, I don't want to bring up another JFrame, but instead replace the contents that are currently on the JFrame with new content. How can I do this? Here is my starting code for the JFrame. I plan to use Container and a FlowLayout (unless I have to use something else to do this):

public class TestGUI extends JFrame
public TestGUI
this.setSize(5, 5);

Container contents = this.getContentPane();
contents.setLayout(new FlowLayout());

Thanks in advance.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us