TabPan
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class TabPan extends JApplet implements ActionListener
{
GridBagLayout gblInput;
GridBagConstraints gbcInput;
JPanel pan1Input;
JPanel pan2Input;
Container contTabPan;
JTabbedPane tabPane;
ImageIcon ico1;
JLabel lCandidateId,lCandidateName,lCandidateAddress, lEmployeeId, lInterviewerName, lTestDate, lTestScore;
JLabel lComents, lRating, lStatus, lInterviewDate;
JTextField tCandidateId, tEmployeeId, tInterviewerName, tTestDate, tTestScore ;
JTextField tComents,tInterviewDate;
JComboBox cmbRating, cmbStatus;
JButton bAccept, bCancel;
String strRating[] = {"1","2","3","4","5","6"};
String strStatus[] = {"Yes","No"};
public void start()
{
gblInput = new GridBagLayout();
gbcInput = new GridBagConstraints();
pan1Input = new JPanel(gblInput);
pan2Input = new JPanel(gblInput);
pan1Input = new JPanel(gblInput);
pan2Input = new JPanel(gblInput);
contTabPan = getContentPane();
// contTabPan.setLayout(gblInput);
contTabPan.setLayout(new GridBagLayout());
pan1Input.setLayout(gblInput);
pan2Input.setLayout(gblInput);
tabPane = new JTabbedPane();
contTabPan.add(tabPane,gbcInput);
// contTabPan.add(tabPane,new FlowLayout());
ico1 = new ImageIcon("an01350a.gif");
}
public void Candidate()
{
lCandidateId = new JLabel("Candidate Id :");
lEmployeeId = new JLabel("Employee Id :");
lInterviewerName = new JLabel("Interviewer Name :");
lTestDate = new JLabel("Test Score :");
lTestScore = new JLabel("Test Score :");
lInterviewDate = new JLabel("Interview Date :");
lComents = new JLabel("Coments :");
lRating = new JLabel("Rating :");
lStatus = new JLabel("Status :");
tCandidateId = new JTextField(6);
tEmployeeId = new JTextField(6);
tInterviewerName = new JTextField(20);
tTestDate = new JTextField(10);
tTestScore = new JTextField(3);
tComents = new JTextField(30);
tInterviewDate = new JTextField(10);
cmbRating = new JComboBox(strRating);
cmbStatus = new JComboBox(strStatus);
bAccept = new JButton("Accept");
bCancel = new JButton("Cancel");
gbcInput.anchor=GridBagConstraints.WEST;
gbcInput.gridx = 1;
gbcInput.gridy = 1;
gblInput.setConstraints(lCandidateId,gbcInput);
pan1Input.add(lCandidateId);
gbcInput.gridx = 2;
gbcInput.gridy = 1;
gblInput.setConstraints(tCandidateId,gbcInput);
pan1Input.add(tCandidateId);
gbcInput.gridx = 1;
gbcInput.gridy = 2;
gblInput.setConstraints(lEmployeeId,gbcInput);
pan1Input.add(lEmployeeId);
gbcInput.gridx = 2;
gbcInput.gridy = 2;
gblInput.setConstraints(tEmployeeId,gbcInput);
pan1Input.add(tEmployeeId);
gbcInput.gridx = 1;
gbcInput.gridy = 3;
gblInput.setConstraints(lInterviewerName,gbcInput);
pan1Input.add(lInterviewerName);
gbcInput.gridx = 2;
gbcInput.gridy = 3;
gblInput.setConstraints(tInterviewerName,gbcInput);
pan1Input.add(tInterviewerName);
gbcInput.gridx = 1;
gbcInput.gridy = 4;
gblInput.setConstraints(lTestDate,gbcInput);
pan2Input.add(lTestDate);
gbcInput.gridx = 2;
gbcInput.gridy = 4;
gblInput.setConstraints(tTestDate,gbcInput);
pan2Input.add(tTestDate);
gbcInput.gridx = 1;
gbcInput.gridy = 5;
gblInput.setConstraints(lTestScore,gbcInput);
pan2Input.add(lTestScore);
gbcInput.gridx = 2;
gbcInput.gridy = 5;
gblInput.setConstraints(tTestScore,gbcInput);
pan2Input.add(tTestScore);
gbcInput.gridx = 1;
gbcInput.gridy = 6;
gblInput.setConstraints(lTestScore,gbcInput);
pan2Input.add(lTestScore);
gbcInput.gridx = 2;
gbcInput.gridy = 6;
gblInput.setConstraints(tTestScore,gbcInput);
pan2Input.add(tTestScore);
gbcInput.gridx = 1;
gbcInput.gridy = 7;
gblInput.setConstraints(lInterviewDate,gbcInput);
pan2Input.add(lInterviewDate);
gbcInput.gridx = 2;
gbcInput.gridy = 7;
gblInput.setConstraints(tInterviewDate,gbcInput);
pan2Input.add(tInterviewDate);
gbcInput.gridx = 1;
gbcInput.gridy = 8;
gblInput.setConstraints(lComents,gbcInput);
pan2Input.add(lComents);
gbcInput.gridx = 2;
gbcInput.gridy = 8;
gbcInput.weightx = 0 ;
gbcInput.fill = GridBagConstraints.HORIZONTAL;
gblInput.setConstraints(tComents,gbcInput);
pan2Input.add(tComents);
gbcInput.gridx = 1;
gbcInput.gridy = 9;
gbcInput.weightx = 0 ;
gbcInput.fill = GridBagConstraints.NONE;
gblInput.setConstraints(lRating,gbcInput);
pan2Input.add(lRating);
gbcInput.gridx = 2;
gbcInput.gridy = 9;
gblInput.setConstraints(cmbRating,gbcInput);
pan2Input.add(cmbRating);
gbcInput.gridx = 1;
gbcInput.gridy = 10;
gblInput.setConstraints(lStatus,gbcInput);
pan2Input.add(lStatus);
gbcInput.gridx = 2;
gbcInput.gridy = 10;
gblInput.setConstraints(cmbStatus,gbcInput);
pan2Input.add(cmbStatus);
gbcInput.gridx = 3;
gbcInput.gridy = 11;
gblInput.setConstraints(bAccept,gbcInput);
pan1Input.add(bAccept);
gbcInput.gridx = 4;
gbcInput.gridy = 11;
gblInput.setConstraints(bCancel,gbcInput);
pan1Input.add(bCancel);
bAccept.addActionListener(this);
bCancel.addActionListener(this);
tabPane.addTab("First Fifty",ico1,pan1Input,"Tool tip First");
ico1 = new ImageIcon("an00130a.gif");
tabPane.addTab("Second Fifty",ico1,pan2Input,"Tool tip Second");
}
public void actionPerformed(ActionEvent evt)
{
JButton source = (JButton) evt.getSource();
if(source.getText().compareTo("Accept") == 0)
{
System.out.println("Candidate Id :" + tCandidateId.getText());
System.out.println("Employee Id :" + tEmployeeId.getText());
System.out.println("Candidate Id :" + tInterviewerName.getText());
System.out.println("Candidate Id :" + tTestDate.getText());
System.out.println("Candidate Id :" + tTestScore.getText());
System.out.println("Candidate Id :" + tComents.getText());
System.out.println("Candidate Id :" + tInterviewDate.getText());
System.out.println("Rating :" + cmbRating.getSelectedItem());
System.out.println("Status :" + cmbStatus.getSelectedItem());
}
else if(source.getText().compareTo("Cancel") == 0)
{
tCandidateId.setText("");
tEmployeeId.setText("");
tInterviewerName.setText("");
tTestDate.setText("");
tTestScore.setText("");
tComents.setText("");
tInterviewDate.setText("");
cmbRating.setSelectedItem("1");
cmbStatus.setSelectedItem("Yes");
}
}
}
/*
*/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class TabPan extends JApplet implements ActionListener
{
GridBagLayout gblInput;
GridBagConstraints gbcInput;
JPanel pan1Input;
JPanel pan2Input;
Container contTabPan;
JTabbedPane tabPane;
ImageIcon ico1;
JLabel lCandidateId,lCandidateName,lCandidateAddress, lEmployeeId, lInterviewerName, lTestDate, lTestScore;
JLabel lComents, lRating, lStatus, lInterviewDate;
JTextField tCandidateId, tEmployeeId, tInterviewerName, tTestDate, tTestScore ;
JTextField tComents,tInterviewDate;
JComboBox cmbRating, cmbStatus;
JButton bAccept, bCancel;
String strRating[] = {"1","2","3","4","5","6"};
String strStatus[] = {"Yes","No"};
public void start()
{
gblInput = new GridBagLayout();
gbcInput = new GridBagConstraints();
pan1Input = new JPanel(gblInput);
pan2Input = new JPanel(gblInput);
pan1Input = new JPanel(gblInput);
pan2Input = new JPanel(gblInput);
contTabPan = getContentPane();
// contTabPan.setLayout(gblInput);
contTabPan.setLayout(new GridBagLayout());
pan1Input.setLayout(gblInput);
pan2Input.setLayout(gblInput);
tabPane = new JTabbedPane();
contTabPan.add(tabPane,gbcInput);
// contTabPan.add(tabPane,new FlowLayout());
ico1 = new ImageIcon("an01350a.gif");
}
public void Candidate()
{
lCandidateId = new JLabel("Candidate Id :");
lEmployeeId = new JLabel("Employee Id :");
lInterviewerName = new JLabel("Interviewer Name :");
lTestDate = new JLabel("Test Score :");
lTestScore = new JLabel("Test Score :");
lInterviewDate = new JLabel("Interview Date :");
lComents = new JLabel("Coments :");
lRating = new JLabel("Rating :");
lStatus = new JLabel("Status :");
tCandidateId = new JTextField(6);
tEmployeeId = new JTextField(6);
tInterviewerName = new JTextField(20);
tTestDate = new JTextField(10);
tTestScore = new JTextField(3);
tComents = new JTextField(30);
tInterviewDate = new JTextField(10);
cmbRating = new JComboBox(strRating);
cmbStatus = new JComboBox(strStatus);
bAccept = new JButton("Accept");
bCancel = new JButton("Cancel");
gbcInput.anchor=GridBagConstraints.WEST;
gbcInput.gridx = 1;
gbcInput.gridy = 1;
gblInput.setConstraints(lCandidateId,gbcInput);
pan1Input.add(lCandidateId);
gbcInput.gridx = 2;
gbcInput.gridy = 1;
gblInput.setConstraints(tCandidateId,gbcInput);
pan1Input.add(tCandidateId);
gbcInput.gridx = 1;
gbcInput.gridy = 2;
gblInput.setConstraints(lEmployeeId,gbcInput);
pan1Input.add(lEmployeeId);
gbcInput.gridx = 2;
gbcInput.gridy = 2;
gblInput.setConstraints(tEmployeeId,gbcInput);
pan1Input.add(tEmployeeId);
gbcInput.gridx = 1;
gbcInput.gridy = 3;
gblInput.setConstraints(lInterviewerName,gbcInput);
pan1Input.add(lInterviewerName);
gbcInput.gridx = 2;
gbcInput.gridy = 3;
gblInput.setConstraints(tInterviewerName,gbcInput);
pan1Input.add(tInterviewerName);
gbcInput.gridx = 1;
gbcInput.gridy = 4;
gblInput.setConstraints(lTestDate,gbcInput);
pan2Input.add(lTestDate);
gbcInput.gridx = 2;
gbcInput.gridy = 4;
gblInput.setConstraints(tTestDate,gbcInput);
pan2Input.add(tTestDate);
gbcInput.gridx = 1;
gbcInput.gridy = 5;
gblInput.setConstraints(lTestScore,gbcInput);
pan2Input.add(lTestScore);
gbcInput.gridx = 2;
gbcInput.gridy = 5;
gblInput.setConstraints(tTestScore,gbcInput);
pan2Input.add(tTestScore);
gbcInput.gridx = 1;
gbcInput.gridy = 6;
gblInput.setConstraints(lTestScore,gbcInput);
pan2Input.add(lTestScore);
gbcInput.gridx = 2;
gbcInput.gridy = 6;
gblInput.setConstraints(tTestScore,gbcInput);
pan2Input.add(tTestScore);
gbcInput.gridx = 1;
gbcInput.gridy = 7;
gblInput.setConstraints(lInterviewDate,gbcInput);
pan2Input.add(lInterviewDate);
gbcInput.gridx = 2;
gbcInput.gridy = 7;
gblInput.setConstraints(tInterviewDate,gbcInput);
pan2Input.add(tInterviewDate);
gbcInput.gridx = 1;
gbcInput.gridy = 8;
gblInput.setConstraints(lComents,gbcInput);
pan2Input.add(lComents);
gbcInput.gridx = 2;
gbcInput.gridy = 8;
gbcInput.weightx = 0 ;
gbcInput.fill = GridBagConstraints.HORIZONTAL;
gblInput.setConstraints(tComents,gbcInput);
pan2Input.add(tComents);
gbcInput.gridx = 1;
gbcInput.gridy = 9;
gbcInput.weightx = 0 ;
gbcInput.fill = GridBagConstraints.NONE;
gblInput.setConstraints(lRating,gbcInput);
pan2Input.add(lRating);
gbcInput.gridx = 2;
gbcInput.gridy = 9;
gblInput.setConstraints(cmbRating,gbcInput);
pan2Input.add(cmbRating);
gbcInput.gridx = 1;
gbcInput.gridy = 10;
gblInput.setConstraints(lStatus,gbcInput);
pan2Input.add(lStatus);
gbcInput.gridx = 2;
gbcInput.gridy = 10;
gblInput.setConstraints(cmbStatus,gbcInput);
pan2Input.add(cmbStatus);
gbcInput.gridx = 3;
gbcInput.gridy = 11;
gblInput.setConstraints(bAccept,gbcInput);
pan1Input.add(bAccept);
gbcInput.gridx = 4;
gbcInput.gridy = 11;
gblInput.setConstraints(bCancel,gbcInput);
pan1Input.add(bCancel);
bAccept.addActionListener(this);
bCancel.addActionListener(this);
tabPane.addTab("First Fifty",ico1,pan1Input,"Tool tip First");
ico1 = new ImageIcon("an00130a.gif");
tabPane.addTab("Second Fifty",ico1,pan2Input,"Tool tip Second");
}
public void actionPerformed(ActionEvent evt)
{
JButton source = (JButton) evt.getSource();
if(source.getText().compareTo("Accept") == 0)
{
System.out.println("Candidate Id :" + tCandidateId.getText());
System.out.println("Employee Id :" + tEmployeeId.getText());
System.out.println("Candidate Id :" + tInterviewerName.getText());
System.out.println("Candidate Id :" + tTestDate.getText());
System.out.println("Candidate Id :" + tTestScore.getText());
System.out.println("Candidate Id :" + tComents.getText());
System.out.println("Candidate Id :" + tInterviewDate.getText());
System.out.println("Rating :" + cmbRating.getSelectedItem());
System.out.println("Status :" + cmbStatus.getSelectedItem());
}
else if(source.getText().compareTo("Cancel") == 0)
{
tCandidateId.setText("");
tEmployeeId.setText("");
tInterviewerName.setText("");
tTestDate.setText("");
tTestScore.setText("");
tComents.setText("");
tInterviewDate.setText("");
cmbRating.setSelectedItem("1");
cmbStatus.setSelectedItem("Yes");
}
}
}
/*
*/
Comments
Post a Comment