Professional Documents
Culture Documents
Project Report On "Project On Student Management": Diploma Engineering (3 Year) (Branch - CO)
Project Report On "Project On Student Management": Diploma Engineering (3 Year) (Branch - CO)
on
(Branch –CO)
Roll no:CO329
ACKNOWLEDGEMENT
JAVA was developed by James Gosling at Sun Microsystems Inc in the year 1995,
later acquired by Oracle Corporation. It is a simple programming language. Java
makes writing, compiling, and debugging programming easy. It helps to create
reusable code and modular programs. Java is a classbased, object-oriented
programming language and is designed to have as few implementation
dependencies as possible. A general-purpose programming language made for
developers to write once run anywhere that is compiled Java code can run on all
platforms that support Java. Java applications are compiled to byte code that can
run on any Java Virtual Machine. The syntax of Java is similar to c/c++.
Swing has about four times the number of User Interface [UI] components as AWT
and is part of the standard Java distribution. By today’s application GUI
requirements, AWT is a limited implementation, not quite capable of providing the
components required for developing complex GUI’s required in modern
commercial applications. The AWT component set has quite a few bugs and really
does take up a lot of system resources when compared to equivalent Swing
resources.
Breif Description:-
Swing components are the basic building blocks of an application. We know that
Swing is a GUI widget toolkit for Java. Every application has some basic
interactive interface for the user. For example, a button, check-box, radio-button,
text-field, etc. These together form the components in Swing.
JButton
JButton class is used to create a push-button on the UI. The button can contain
some display text or image. It generates an event when clicked and double-clicked.
A JButton can be implemented in the application by calling one of its constructors.
JLabel
JLabel class is used to render a read-only text label or images on the UI. It does not
generate any event.
JTextField
JTextField renders an editable single-line text box. A user can input non-formatted
text in the box. To initialize the text field, call its constructor and pass an optional
integer parameter to it. This parameter sets the width of the box measured by the
number of columns. It does not limit the number of characters that can be input in
the box.
JTextArea
JTextArea class renders a multi-line text box. Similar to the JTextField, a user can
input non-formatted text in the field. The constructor for JTextArea also expects
two integer parameters which define the height and width of the text-area in
columns. It does not restrict the number of characters that the user can input in the
text-area.
JCheckBox
JCheckBox renders a check-box with a label. The check-box has two states –
on/off. When selected, the state is on and a small tick is displayed in the box.
It returns a checkbox with the label Show Help. Notice the second parameter in the
constructor. It is a boolean value that indicates the default state of the check-box.
True means the check-box is defaulted to on state.
JRadioButton
JRadioButton is used to render a group of radio buttons in the UI. A user can select
one choice from the group.It creates a button group and three radio button
elements. All three elements are then added to the group. This ensures that only
one option out of the available options in the group can be selected at a time. The
default selected option is set to Easy.
Now that you have got the gist of components in Swing, it is highly recommended
to dive deeper and explore more. Swing components are fun to play around with
and can help create some real cool applications. So, get your hands-on on these
components by including them in your Swing application.
What Is ODBC/JDBC?
My Code:
JLabel
lblStudentID,lblStudentName,lblContact,lblGender,lblCity,lblEmail,lblE
nrollment,lblBranchID;
JTextField
txtStudentID,txtBranchID,txtStudentName,txtContact,txtCity,txtEmail,t
xtEnrollment;
JRadioButton rbMale,rbFemale;
ButtonGroup z;
JComboBox cmbStudentName;
JButton btNew,btSave,btView,btDelete,btUpdate,btEdit;
Panel pnlTitle,pnlInterface,pnlButton,pnlCombo;
FrmStudent(){ setSize(600,600);
setLayout(null); int
x=10,y=10,w=100,h=30,g=10,x1=120;
y=y+h+g;
y=y+h+g;
y=y+h+g;
y=y+h+g;
lblGender=new JLabel("Gender");
z=new ButtonGroup(); rbMale=new
JRadioButton("Male"); rbFemale=new
JRadioButton("Female");
z.add(rbMale);
z.add(rbFemale);
lblGender.setBounds(x,y,w,h);
rbMale.setBounds(x+110,y,70,h);
rbFemale.setBounds(x+190,y,70,h);
y=y+h+g;
lblCity=new JLabel("City");
txtCity=new JTextField();
lblCity.setBounds(x,y,w,h);
txtCity.setBounds(x1,y,w,h);
y=y+h+g;
lblEmail=new JLabel("Email");
txtEmail=new JTextField();
lblEmail.setBounds(x,y,w,h);
txtEmail.setBounds(x1,y,w,h);
y=y+h+g;
lblEnrollment=new JLabel("Enrollment No.");
txtEnrollment=new JTextField();
lblEnrollment.setBounds(x,y,w,h);
txtEnrollment.setBounds(x1,y,w,h);
y=y+h+g;
btNew=new JButton("New");
btNew.setBounds(x,y,100,h); btSave=new
JButton("Save"); btSave.setBounds(x+100,y,100,h);
btView=new JButton("View");
btView.setBounds(x+200,y,100,h);
y=y+h+g;
btDelete=new JButton("Delete");
btDelete.setBounds(x,y,100,h); btUpdate=new
JButton("Update");
btUpdate.setBounds(x+100,y,100,h); btEdit=new
JButton("Edit"); btEdit.setBounds(x+200,y,100,h);
y=y+h+g;
y=y+h+g;
cmbStudentName=new JComboBox();
cmbStudentName.setBounds(x,y,w,h);
add(lblStudentID);
add(lblStudentName);
add(lblContact); add(lblGender);
add(lblCity);
add(lblEmail);
add(lblEnrollment);
add(lblBranchID);
add(txtStudentID);
add(txtBranchID);
add(txtStudentName);
add(txtContact); add(txtCity);
add(txtEmail);
add(txtEnrollment);
add(cmbStudentName);
add(btNew); add(btSave);
add(btView);
add(btDelete); add(btUpdate);
add(btEdit);
add(rbMale); add(rbFemale);
show();
new FrmStudent();
}
Output:-