Results 1 to 2 of 2

Thread: Tabbed Panes

  1. #1
    njliven is offline Member
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default Tabbed Panes

    I am taking a class in JAVA and I have several little programs written in separate classes. Now I need to add these to a TabbedPane. I can create a tabbed pane that display messages and the tab names, but what do I do to get my tabs to bring up my programs. Here is a snipped of the code I have. Which displays the tab with the a "Welcome" message and labels the tab Tab#1. Now I need to be able to tell this tab to put the program there so I can run it from the tab. Thanks for any help anyone can provide.

    public class TabbedPane extends JFrame
    {

    public TabbedPane()
    {
    super( "Test Company Name " );

    JTabbedPane tab = new JTabbedPane();

    JLabel l1 = new JLabel( "Welcome", SwingConstants.CENTER );
    JPanel p1 = new JPanel();
    p1.add( l1 );
    tab.addTab( "Tab#1", null, p1, " Panel #1" );

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: Tabbed Panes

    So, you don't really want an app to actually launch other apps. Rather, you'll have an app that might incorporate many other classes. The app contains the GUI, and when a user clicks on a tab, the app populates that tab with fields and data that might be derived from a particular class.

Similar Threads

  1. Formatting contents within Tabbed Panes
    By Redefine12 in forum AWT / Swing
    Replies: 6
    Last Post: 03-21-2012, 04:11 PM
  2. JTab Panes
    By Nidi in forum New To Java
    Replies: 2
    Last Post: 03-02-2011, 04:27 AM
  3. Layered Panes
    By teckno101 in forum AWT / Swing
    Replies: 1
    Last Post: 10-03-2009, 11:16 PM
  4. panes, frames and ddm's :|
    By skatefreak in forum New To Java
    Replies: 1
    Last Post: 08-09-2009, 10:21 AM
  5. Two content panes in one GUI?
    By Leprechaun in forum New To Java
    Replies: 1
    Last Post: 01-31-2008, 04:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •