JTabbedPane problem

hello.

this is james mcfadden. i am currently developing a video library system in Java. it involves developing a video library menu. the video library menu is supposed to consist of an administrator's section, a new user's section and an existing user's section. i am using JTabbedPane to navigate between the 3 sections of the menu. the following program compiles but it does not run the way i expect it to. when i run the program, only a blank frame is displayed on screen and nothing else. how can i solve this problem?

thank you for helping me solve this problem.

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.border.*;

import java.io.*;

import java.util.*;

publicclass VideoLibrarySystemextends JPanelimplements ActionListener{

private JTabbedPane jtp =new JTabbedPane();

private JPanel cP1 =new JPanel();

private JPanel cP2 =new JPanel();

private JPanel cP3 =new JPanel();

private JPanel bP1 =new JPanel();

private JPanel bP2 =new JPanel();

private JPanel bP3 =new JPanel();

private JButton jbAdministratorLogOn =new JButton("Log On");

private JButton jbNewUserRegister =new JButton("Register");

private JButton jbExistingUserLogOn =new JButton("Log On");

public VideoLibrarySystem(){

// arrange GUI components

cP1.setLayout(new BorderLayout());

cP2.setLayout(new BorderLayout());

cP3.setLayout(new BorderLayout());

bP1.setBorder(new TitledBorder("Make a choice"));

bP2.setBorder(new TitledBorder("Make a choice"));

bP3.setBorder(new TitledBorder("Make a choice"));

bP1.add(jbAdministratorLogOn);

bP2.add(jbNewUserRegister);

bP3.add(jbExistingUserLogOn);

cP1.add(bP1, BorderLayout.SOUTH);

cP2.add(bP2, BorderLayout.SOUTH);

cP3.add(bP3, BorderLayout.SOUTH);

jtp.addTab("Administrator", cP1);

jtp.addTab("New User", cP2);

jtp.addTab("Existing User", cP3);

jbAdministratorLogOn.addActionListener(this);

jbNewUserRegister.addActionListener(this);

jbExistingUserLogOn.addActionListener(this);

}

//Process button presses

publicvoid actionPerformed(ActionEvent e){

if(e.getSource() == jbAdministratorLogOn){

//LogOn logon = new LogOn();

}

if(e.getSource() == jbNewUserRegister){

//MemberForm member = new MemberForm();

//member.getInput();

//member.setVisible(true);

}

if(e.getSource() == jbExistingUserLogOn){

//LogOn logon = new LogOn();;

}

}

publicstaticvoid main(String[] args){

// set Frame attributes

JFrame jf =new JFrame("Video Library System");

jf.addWindowListener(new WindowAdapter(){

publicvoid windowClosing(WindowEvent e){

System.exit(0);

}

});

jf.getContentPane().add(new VideoLibrarySystem(), BorderLayout.CENTER);

jf.setSize(500, 300);

jf.setVisible(true);

}

}

[5809 byte] By [james-mcfaddena] at [2007-11-27 8:59:04]
# 1
Change jf.setVisible(true); tojf.pack();jf.setVisible(true);
masijade.a at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...
# 2
i did what you told me to do. but i have the same problem again. what do i do next?
james-mcfaddena at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...
# 3
i did what you told me to do. but i have the same problem again. what do i do next? should i put everything or most things inside the main() method?
james-mcfaddena at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...
# 4
it's ok. i already know where i went wrong.
james-mcfaddena at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...
# 5
You Need to add all the Three Panels i.e bp1,bp2& bp3 in to JFrame also .Try that also,and then have a look.
airforce7a at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...
# 6
> You Need to add all the Three Panels i.e bp1,bp2& bp3> in to JFrame also .Try that also,and then have a> look.No. And I thinkl he may have already gotten it. At the end of the VideoLibrarySystem constructor addadd(jtp);
masijade.a at 2007-7-12 21:26:02 > top of Java-index,Java Essentials,New To Java...