The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002

Advertisement

Advertisement

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.

Message:

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
{
super();
this.setSize(5, 5);

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

Thanks in advance.
Hiran




Replies:

Sponsored Links



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