import javax.swing.table.DefaultTableModel;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Owner
*/
public class Registration extends javax.swing.JFrame {
/**
* Creates new form Registration
*/
public Registration() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
REGISTRATION = new javax.swing.JLabel();
lStudentno = new javax.swing.JLabel();
fStudentno = new javax.swing.JTextField();
lGivename = new javax.swing.JLabel();
fGivenname = new javax.swing.JTextField();
lMiddlename = new javax.swing.JLabel();
fMiddlename = new javax.swing.JTextField();
lSurname = new javax.swing.JLabel();
fSurname = new javax.swing.JTextField();
lCourse = new javax.swing.JLabel();
fCourse = new javax.swing.JTextField();
lYear = new javax.swing.JLabel();
fYear = new javax.swing.JTextField();
lSection = new javax.swing.JLabel();
fSection = new javax.swing.JTextField();
bAdd = new javax.swing.JButton();
bExit = new javax.swing.JButton();
lContactno = new javax.swing.JLabel();
fContactno = new javax.swing.JTextField();
lEmail = new javax.swing.JLabel();
fEmail = new javax.swing.JTextField();
CLEAR = new javax.swing.JButton();
Reminder = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
REGISTRATION.setFont(new java.awt.Font("Courier New", 1, 36)); // NOI18N
REGISTRATION.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
REGISTRATION.setText("REGISTRATION");
lStudentno.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lStudentno.setText("Student no. :");
lGivename.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lGivename.setText("Given Name :");
lMiddlename.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lMiddlename.setText("Middle Name :");
lSurname.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lSurname.setText("Surname :");
lCourse.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lCourse.setText("Course :");
fCourse.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fCourseActionPerformed(evt);
}
});
lYear.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lYear.setText("Year :");
lSection.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lSection.setText("Section :");
bAdd.setText("ADD");
bAdd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bAddActionPerformed(evt);
}
});
bExit.setText("EXIT");
bExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bExitActionPerformed(evt);
}
});
lContactno.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lContactno.setText("Contact no. :");
fContactno.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fContactnoActionPerformed(evt);
}
});
lEmail.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
lEmail.setText("E-mail :");
fEmail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fEmailActionPerformed(evt);
}
});
CLEAR.setText("CLEAR");
CLEAR.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CLEARActionPerformed(evt);
}
});
Reminder.setFont(new java.awt.Font("Gungsuh", 1, 18)); // NOI18N
Reminder.setForeground(new java.awt.Color(255, 0, 51));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(68, 68, 68)
.addComponent(REGISTRATION))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lStudentno)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fStudentno, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lGivename)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fGivenname, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lMiddlename)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fMiddlename, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lSurname)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fSurname, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(bAdd)
.addComponent(lSection))
.addGap(27, 27, 27)
.addComponent(CLEAR)
.addGap(41, 41, 41)
.addComponent(bExit))
.addComponent(lCourse)
.addComponent(lYear)))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lContactno)
.addComponent(lEmail))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(fEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fSection, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fContactno, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fYear, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 51, Short.MAX_VALUE)
.addComponent(Reminder, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(42, 42, 42))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(REGISTRATION, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lStudentno)
.addComponent(fStudentno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lGivename)
.addComponent(fGivenname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lMiddlename)
.addComponent(fMiddlename, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lSurname)
.addComponent(fSurname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lCourse)
.addComponent(fCourse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lYear)
.addComponent(fYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lSection)
.addComponent(fSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lContactno)
.addComponent(fContactno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lEmail)
.addComponent(fEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Reminder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bAdd)
.addComponent(bExit)
.addComponent(CLEAR))
.addGap(30, 30, 30))
);
pack();
}// </editor-fold>
private void bAddActionPerformed(java.awt.event.ActionEvent evt) {
DefaultTableModel model = (DefaultTableModel) tStudents.getModel();
model.addRow(new Object[]{fStudentno.getText(),fGivenname.getText(),fSurname.getText(),fCourse.getText(),fYear.getText(),fSection.getText()});
}
private void bExitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void fContactnoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void fEmailActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void CLEARActionPerformed(java.awt.event.ActionEvent evt) {
fStudentno.setText("");
fGivenname.setText("");
fMiddlename.setText("");
fSurname.setText("");
fCourse.setText("");
fYear.setText("");
fSection.setText("");
fContactno.setText("");
fEmail.setText("");
}
private void fCourseActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Registration().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton CLEAR;
private javax.swing.JLabel REGISTRATION;
private javax.swing.JLabel Reminder;
private javax.swing.JButton bAdd;
private javax.swing.JButton bExit;
private javax.swing.JTextField fContactno;
private javax.swing.JTextField fCourse;
private javax.swing.JTextField fEmail;
private javax.swing.JTextField fGivenname;
private javax.swing.JTextField fMiddlename;
private javax.swing.JTextField fSection;
private javax.swing.JTextField fStudentno;
private javax.swing.JTextField fSurname;
private javax.swing.JTextField fYear;
private javax.swing.JLabel lContactno;
private javax.swing.JLabel lCourse;
private javax.swing.JLabel lEmail;
private javax.swing.JLabel lGivename;
private javax.swing.JLabel lMiddlename;
private javax.swing.JLabel lSection;
private javax.swing.JLabel lStudentno;
private javax.swing.JLabel lSurname;
private javax.swing.JLabel lYear;
// End of variables declaration
}