Dr.
AMBEDKAR INSTITUTE OF TECHNOLOGY
[An Autonomous Institution, Affiliated to VTU, Belgaum and Aided by Government of Karnataka]
Near Jnana Bharathi Campus, Mallathalli, Bangalore-560 056
JAVA & J2EE ASSIGNMENT(CS52)
ON
“ STUDENT INFORMATION USING JTABBEDPANE”
IN
COMPUTER SCIENCE & ENGINEERING
SUBMITTED BY
STUDENTS NAMES USN NUMBER
S NARASIMHA 1DA16CS174
VAIBHAV VIVEK 1DA17CS185
ANUSHA D 1DA17CS200
VIJAYALAKSHMI 1DA17CS191
SMRITI BHIMSEN 1DA17CS166
ASIF SALIYA 1DA16CS023
SUJAN GHALE 1DA17CS174
SUVIJ SURYA BV 1DA17CS179
H HMINGTHANGZELI 1DA15CS036
FACULTY-IN-CHARGE
Dr. Smitha Shekar B
Associate Professor
Department of C.S.E, Dr.A.I.T
2019-20
1. Explore JtabbedPane with necessary component to display Student information
//JTab.java
import java.awt.Color;
import java.awt.Font;
import javax.swing.*;
import javax.swing.border.LineBorder;
import com.toedter.calendar.JDateChooser;
public class JTab
{
public static void main(String[] args)
{
JFrame jf=new JFrame("JTabbedPane");
jf.setVisible(true);
jf.setBounds(100, 50,1000, 550);
jf.setLayout(null);
JTabbedPane tab=new JTabbedPane();
tab.setBounds(0, 0, 1000, 550);
jf.add(tab);
JPanel p1=new JPanel();
tab.addTab("StudentInfo",p1);
p1.setLayout(null);
p1.setBackground(new Color(44, 62,80));
JLabel l1=new JLabel("Name: ");
l1.setBounds(400, 0, 110, 37);
p1.add(l1);
l1.setForeground(new Color(236, 240, 241));
l1.setFont(new Font("Tahoma", Font.PLAIN, 18));
JTextField t1=new JTextField();
t1.setBounds(400, 30, 256, 26);
t1.setFont(new Font("Tahoma", Font.PLAIN, 14));
t1.setBackground(new Color(108, 122,137));
p1.add(t1);
t1.setColumns(10);
JLabel l2=new JLabel("USN: ");
l2.setBounds(400, 60, 91, 40);
l2.setForeground(new Color(236, 240, 241));
l2.setFont(new Font("Tohoma", Font.PLAIN, 18));
p1.add(l2);
JTextField t2=new JTextField();
t2.setBounds(400, 92, 256, 26);
t2.setFont(new Font("Tahoma", Font.PLAIN, 14));
t2.setBackground(new Color(108, 122,137));
p1.add(t2);
JLabel l3=new JLabel("Mobile no: ");
l3.setFont(new Font("Tahoma", Font.PLAIN, 18));
l3.setForeground(new Color(236, 240, 241));
l3.setBounds(400, 122, 91, 40);
p1.add(l3);
JTextField t3= new JTextField();
t3.setBounds(400, 153, 256, 26);
t3.setFont(new Font("Tahoma", Font.PLAIN, 14));
t3.setBackground(new Color(108, 122,137));
p1.add(t3);
JLabel l4=new JLabel("BirthDate: ");
l4.setBounds(400, 180, 91, 40);
l4.setFont(new Font("Tahoma", Font.PLAIN, 18));
l4.setForeground(new Color(236, 240, 241));
p1.add(l4);
JDateChooser t4=new JDateChooser();
t4.setBounds(400,215, 256, 26);
t4.setFont(new Font("Tahoma", Font.PLAIN, 14));
t4.setBackground(new Color(108, 122,137));
p1.add(t4);
JLabel l5=new JLabel("Email: ");
l5.setBounds(400, 238, 91, 40);
l5.setFont(new Font("Tahoma", Font.PLAIN, 18));
l5.setForeground(new Color(236, 240, 241));
p1.add(l5);
JTextField t5=new JTextField();
t5.setBounds(400, 275, 256, 26);
t5.setFont(new Font("Tahoma", Font.PLAIN, 14));
t5.setBackground(new Color(108, 122,137));
p1.add(t5);
JLabel l6=new JLabel("Address: ");
l6.setBounds(400, 300, 91, 40);
l6.setFont(new Font("Tahoma", Font.PLAIN, 18));
l6.setForeground(new Color(236, 240, 241));
p1.add(l6);
JTextArea t6=new JTextArea();
t6.setBounds(400, 333, 256, 80);
t6.setFont(new Font("Tahoma", Font.PLAIN, 14));
t6.setBackground(new Color(108, 122,137));
p1.add(t6);
JButton b1=new JButton("Submit");
b1.setFont(new Font("Tahoma", Font.BOLD, 14));
b1.setBackground(new Color(34, 167,240));
b1.setForeground(new Color(255, 255, 255));
b1.setBounds(470, 440, 125, 30);
JPanel p2=new JPanel();
tab.addTab("Course",p2);
p2.setBackground(new Color(44, 62,80));
p2.setLayout(null);
JLabel l7=new JLabel("Department: ");
l7.setBounds(400, 10, 108,30);
p2.add(l7);
l7.setForeground(new Color(236, 240, 241));
l7.setFont(new Font("Tahoma", Font.PLAIN, 18));
JComboBox cb = new JComboBox();
cb.setModel(new DefaultComboBoxModel(new String[] {"Computer Science and Engineering",
"Mechanical Engineering","Electronics and communication engineering", "Electrical and Electronics
Engineering","Civil Engineering"}));
cb.setBounds(400,40,256, 26);
p2.add(cb);
JLabel l8=new JLabel("Year: ");
l8.setBounds(400,65, 91, 40);
l8.setForeground(new Color(236, 240, 241));
l8.setFont(new Font("Tahoma", Font.PLAIN, 18));
p2.add(l8);
JComboBox cb2 = new JComboBox();
cb2.setModel(new DefaultComboBoxModel(new String[] {"1 Year","2 Year","3 Year", "4 Year"}));
cb2.setBounds(400, 98, 256, 26);
p2.add(cb2);
JLabel l9=new JLabel("Sem: ");
l9.setBounds(400,120,91,40);
l9.setForeground(new Color(236, 240, 241));
l9.setFont(new Font("Tahoma", Font.PLAIN, 18));
p2.add(l9);
JComboBox cb3 = new JComboBox();
cb3.setModel(new DefaultComboBoxModel(new String[] {"1","2","3", "4","5","6"}));
cb3.setBounds(400,155,256,26);
p2.add(cb3);
JButton b2=new JButton("Submit");
b2.setFont(new Font("Tahoma", Font.BOLD, 14));
b2.setBackground(new Color(34, 167,240));
b2.setForeground(new Color(255, 255, 255));
b2.setBounds(470, 350, 125, 30);
p2.add(b2);
}
}
OUTPUT: