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);
}
}

