Create a online registration system for students usingJava net. Beans
Answer
PreferenceUI.java:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import Register.Staff;
import Register.Database;
import java.util.Set;
public class PreferenceUI extends JFrame implementsActionListener{
/**
*
* @generated “UML to Java V1.4(com.ibm.xtools.transform.uml2.java.internal.UML2JavaTransform)”
*/
private Staff staff;
String a1,a2,a3;
JButton b=new JButton(“Submit preference”);
JPanel p;
JLabel l1,l2,l3;
JTextField t1,t2,t3;
/**
* @return the staff
* @generated “UML to Java V1.4(com.ibm.xtools.transform.uml2.java.internal.UML2JavaTransform)”
*/
public PreferenceUI()
{
p=new JPanel(new GridLayout(4,4));
l1=new JLabel(“Course1:”);
l2=new JLabel(“course2:”);
l3=new JLabel(“course3:”);
t1=new JTextField(40);
t2=new JTextField(40);
t3=new JTextField(40);
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(l3);
p.add(t3);
add(p);
add(b,BorderLayout.SOUTH);
b.addActionListener(this);
}
public Staff getStaff() {
return staff;
}
public void actionPerformed(ActionEvent ae)
{
String a1=t1.getText();
String a2=t2.getText();
String a3=t3.getText();
if(a1.equalsIgnoreCase(“Computer Science”) ||a2.equalsIgnoreCase(“Maths”)|| a3.equalsIgnoreCase(“OOAD”))
{
JOptionPane.showMessageDialog(null,”Allocatedsuccessfully”);
}
else
{
JOptionPane.showMessageDialog(this,”Not successfull”);
}
}
/**
* @param theStaff the staff to set
* @generated “UML to Java V1.4(com.ibm.xtools.transform.uml2.java.internal.UML2JavaTransform)”
*/
public void setStaff(Staff theStaff) {
staff = theStaff;
}
/**
*
* @generated “UML to Java V1.4(com.ibm.xtools.transform.uml2.java.internal.UML2JavaTransform)”
*/
private Database database;
/**
* @return the database
* @generated “UML to Java