Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Tabbed Panes Posted by njliven on 14 Oct 2012 at 7:46 AM
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" );




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.