Вы находитесь на странице: 1из 30

//Coded By: //Castro, Kirby Marie //David, Armel //De Leon, Jasmin //Diolanda, Kevin //Samia, April //Yutuc,

John Daniel

//Y-201

import java.awt.*; import javax.swing.*; import java.awt.event.*;

public class Registration { private JTextField studNum, studName, classCodeone, classCodetwo, classCodethree, subjNameone, subjNametwo, subjNamethree, unitNumone, unitNumtwo, unitNumthree,labSubj, tuition, studentSearch, searchName, classSearchone, classSearchtwo, classSearchthree, subjSearchone, subjSearchtwo, subjSearchthree, unitSearchone, unitSearchtwo, labSearch, unitSearchthree, tuitionSearch; private JLabel label1, label2, label3, label4, label5, label6, label7, label8, label9, label10, label11, label12, label13, label14, label15, label16, label17, label18, label19, label20, label21, label22, label23, label24, label25, label26, label27, label28, label29, label30,label31,tuitionFee, lbstudNum, lbstudName, lbclassCodeone, lbclassCodetwo, lbclassCodethree, lbsubjNameone, lbsubjNametwo, lbsubjNamethree, lbunitNumone, lbunitNumtwo, lbunitNumthree,lblabSubj, lbtuition, lbstudentSearch, lbsearchName, lbclassSearchone, lbclassSearchtwo, lbclassSearchthree, lbsubjSearchone,

lbsubjSearchtwo, lbsubjSearchthree, lbunitSearchone, lbunitSearchtwo, lblabSearch, lbunitSearchthree, lbtuitionSearch; public int stNum, cCode1, cCode2, cCode3, uNum1, uNum2, uNum3, searchNum, tFee, y=4, nLab, lFee = 450, mFee = 1000, units, setLoop; public String in1, in2, in3, in4, in5, in6, code1, code2, code3, subj1, subj2, subj3, unit1, unit2, unit3, disp3, numLab, inSearch; private JButton button1, button2, button3; private ButtonHandler handler; private ButtonHandler1 handler2; private ButtonHandler3 handler3; public Students stud[] = new Students[50]; Registration() { stud[0] = new Students(0, "Armel", 1, 2, 3, 3, 3, 3, "Logic", "Dincal", "Prosta", 1, 18450); stud[1] = new Students(1, "April", 1, 2, 3, 3, 3, 3, "Logic", "Dincal", "Prosta", 1, 18450); stud[2] = new Students(2, "Jasmin", 1, 2, 3, 3, 3, 3, "Logic", "Dincal", "Prosta", 2, 18900); stud[3] = new Students(3, "Kevin", 1, 2, 3, 3, 3, 3, "Logic", "Dincal", "Prosta", 3, 19350); stud[4] = new Students(4, "Kirby", 1, 2, 3, 3, 3, 3, "Logic", "Dincal", "Prosta", 2, 18900); JFrame frmF = new JFrame("Loading..."); //text fields displaying inputted or edited values studNum = new JTextField(); studNum.setEditable(false); studName = new JTextField(); studName.setEditable(false);

classCodeone = new JTextField(); classCodeone.setEditable(false); classCodetwo = new JTextField(); classCodetwo.setEditable(false); classCodethree = new JTextField(); classCodethree.setEditable(false); subjNameone = new JTextField(); subjNameone.setEditable(false); subjNametwo = new JTextField(); subjNametwo.setEditable(false); subjNamethree = new JTextField(); subjNamethree.setEditable(false); unitNumone = new JTextField(); unitNumone.setEditable(false); unitNumtwo = new JTextField(); unitNumtwo.setEditable(false); unitNumthree = new JTextField(); unitNumthree.setEditable(false); labSubj = new JTextField(); labSubj.setEditable(false); tuition = new JTextField(); tuition.setEditable(false);

//showing student files after searching studentSearch = new JTextField(); studentSearch.setEditable(false);

searchName = new JTextField(); searchName.setEditable(false); classSearchone = new JTextField(); classSearchone.setEditable(false); classSearchtwo = new JTextField(); classSearchtwo.setEditable(false); classSearchthree = new JTextField(); classSearchthree.setEditable(false); subjSearchone = new JTextField(); subjSearchone.setEditable(false); subjSearchtwo = new JTextField(); subjSearchtwo.setEditable(false); subjSearchthree = new JTextField(); subjSearchthree.setEditable(false); unitSearchone = new JTextField(); unitSearchone.setEditable(false); unitSearchtwo = new JTextField(); unitSearchtwo.setEditable(false); labSearch = new JTextField(); labSearch.setEditable(false); unitSearchthree = new JTextField(); unitSearchthree.setEditable(false); tuitionSearch = new JTextField(); tuitionSearch.setEditable(false);

button1 = new JButton("Input subjects");//click to enter new record

button2 = new JButton("Search now");//search a record button3 = new JButton("Edit"); handler = new ButtonHandler(); button1.addActionListener(handler); handler2 = new ButtonHandler1(); button2.addActionListener(handler2); handler3 = new ButtonHandler3(); button3.addActionListener(handler3); label1 = new JLabel(" Registration Form:");

label2 = new JLabel("");//spacer labels label3 = new JLabel(""); label4 = new JLabel(""); label5 = new JLabel(""); label6 = new JLabel(""); label7 = new JLabel(" label8 = new JLabel(""); label9 = new JLabel(""); label10 = new JLabel(""); label11 = new JLabel(""); label12 = new JLabel(""); label13 = new JLabel(""); label14 = new JLabel(""); label15 = new JLabel(""); label16 = new JLabel(""); label17 = new JLabel(""); label18 = new JLabel(""); New Entry: ");

label19 = new JLabel(""); label20 = new JLabel(""); label21 = new JLabel(""); label22 = new JLabel(""); label23 = new JLabel(""); label24 = new JLabel(""); label25 = new JLabel(""); label26 = new JLabel(""); label27 = new JLabel(""); label28 = new JLabel(""); label29 = new JLabel(""); label30 = new JLabel(""); label31 = new JLabel(""); //labels to for inputted values in text fields lbstudNum = new JLabel(" lbstudName = new JLabel(" Student Number: "); Student Name: "); Class Code: "); Class Code: "); Class Code: "); Subject: "); Subject: "); Subject: ");

lbclassCodeone = new JLabel(" lbclassCodetwo = new JLabel(" lbclassCodethree = new JLabel(" lbsubjNameone = new JLabel(" lbsubjNametwo = new JLabel(" lbsubjNamethree = new JLabel(" lbunitNumone = new JLabel(" lbunitNumtwo = new JLabel(" lbunitNumthree = new JLabel(" lblabSubj = new JLabel("

Units: "); Units: "); Units: ");

Number of Labs: ");

lbtuition = new JLabel("

Tuition Fee: ");

//labels for search text fields lbstudentSearch = new JLabel(" lbsearchName = new JLabel(" Student Number: "); Name: "); Class Code: "); Class Code: "); Class Code: "); Subject: "); Subject: "); Subjet: "); Units: "); Units: ");

lbclassSearchone = new JLabel(" lbclassSearchtwo = new JLabel(" lbclassSearchthree = new JLabel(" lbsubjSearchone = new JLabel(" lbsubjSearchtwo = new JLabel(" lbsubjSearchthree = new JLabel(" lbunitSearchone = new JLabel(" lbunitSearchtwo = new JLabel(" lblabSearch = new JLabel("

Number of Labs: "); Units: "); Tuition Fee: ");

lbunitSearchthree = new JLabel(" lbtuitionSearch = new JLabel("

frmF.setSize(800,1000);

frmF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frmF.setLayout(new GridLayout(14,6));

frmF.add(label1); frmF.add(label2); frmF.add(label3); frmF.add(label4); frmF.add(label5); frmF.add(label6); //display input values frmF.add(label7); frmF.add(lbstudNum); frmF.add(studNum); frmF.add(lbstudName); frmF.add(studName); frmF.add(label8);

frmF.add(lbclassCodeone); frmF.add(classCodeone); frmF.add(lbunitNumone); frmF.add(unitNumone); frmF.add(lbsubjNameone); frmF.add(subjNameone);

frmF.add(lbclassCodetwo); frmF.add(classCodetwo); frmF.add(lbunitNumtwo); frmF.add(unitNumtwo); frmF.add(lbsubjNametwo);

frmF.add(subjNametwo);

frmF.add(lbclassCodethree); frmF.add(classCodethree); frmF.add(lbunitNumthree); frmF.add(unitNumthree); frmF.add(lbsubjNamethree); frmF.add(subjNamethree);

frmF.add(label9); frmF.add(lblabSubj); frmF.add(labSubj); frmF.add(lbtuition); frmF.add(tuition); frmF.add(label12);

frmF.add(label13); frmF.add(label14); frmF.add(button1);//button to input frmF.add(button3);//button to edit frmF.add(label25); frmF.add(label15);

frmF.add(label26); frmF.add(label27); frmF.add(label28);

frmF.add(label29); frmF.add(label30); frmF.add(label31);

//display search values frmF.add(label16); frmF.add(lbstudentSearch); frmF.add(studentSearch); frmF.add(lbsearchName); frmF.add(searchName); frmF.add(label17);

frmF.add(lbclassSearchone); frmF.add(classSearchone); frmF.add(lbsubjSearchone); frmF.add(subjSearchone); frmF.add(lbunitSearchone); frmF.add(unitSearchone);

frmF.add(lbclassSearchtwo); frmF.add(classSearchtwo); frmF.add(lbsubjSearchtwo); frmF.add(subjSearchtwo); frmF.add(lbunitSearchtwo); frmF.add(unitSearchtwo);

frmF.add(lbclassSearchthree); frmF.add(classSearchthree); frmF.add(lbsubjSearchthree); frmF.add(subjSearchthree); frmF.add(lbunitSearchthree); frmF.add(unitSearchthree);

frmF.add(label18); frmF.add(lblabSearch); frmF.add(labSearch); frmF.add(lbtuitionSearch); frmF.add(tuitionSearch); frmF.add(label21);

frmF.add(label22); frmF.add(label23); frmF.add(button2);//button to search

frmF.setVisible(true); } private class ButtonHandler implements ActionListener {

public void actionPerformed(ActionEvent e)//implementing input { units = 0;

do//enter student number { try { setLoop = 1; in1 = JOptionPane.showInputDialog("Enter Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+in1,"Enter",JOptionPane.WARNING_MESSAGE); stNum = Integer.parseInt(in1); for(int x=0; x<=y ;x++) { while(stNum == stud[x].studNum) { JOptionPane.showMessageDialog(null,"Student number already exists","Enter",JOptionPane.WARNING_MESSAGE); in1 = JOptionPane.showInputDialog("Enter Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+in1,"Enter",JOptionPane.WARNING_MESSAGE); stNum = Integer.parseInt(in1);

} } } catch(NumberFormatException except) {

JOptionPane.showMessageDialog(null,"Input Error! Input again. ","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0); in2 = JOptionPane.showInputDialog("Enter Name: "); JOptionPane.showMessageDialog(null,"You have entered:"+in2,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter class code { try { code1 = JOptionPane.showInputDialog("Enter Class Code 1: "); JOptionPane.showMessageDialog(null,"You have entered: "+code1,"Enter",JOptionPane.WARNING_MESSAGE); cCode1 = Integer.parseInt(code1); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode1 = 0; } }while(cCode1 == 0);

subj1 = JOptionPane.showInputDialog("Enter Subject Name 1: ");//enter subject

JOptionPane.showMessageDialog(null,"You have entered: "+subj1,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter unit { try { unit1 = JOptionPane.showInputDialog("Enter Unit 1: "); JOptionPane.showMessageDialog(null,"You have entered: "+unit1,"Enter",JOptionPane.WARNING_MESSAGE); uNum1 = Integer.parseInt(unit1); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum1 = 0; } }while(uNum1 == 0); units += uNum1;

do//enter class code { try { code2 = JOptionPane.showInputDialog("Enter Class Code 2: ");

JOptionPane.showMessageDialog(null,"You have entered: "+code2,"Enter",JOptionPane.WARNING_MESSAGE); cCode2 = Integer.parseInt(code2); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode2 = 0; } }while(cCode2 == 0);

subj2 = JOptionPane.showInputDialog("Enter Subject Name 2: ");//enter subject JOptionPane.showMessageDialog(null,"You have entered: "+subj2,"Enter",JOptionPane.WARNING_MESSAGE);

do { try { unit2 = JOptionPane.showInputDialog("Enter Unit 2: ");//enter units JOptionPane.showMessageDialog(null,"You have entered: "+unit2,"Enter",JOptionPane.WARNING_MESSAGE); uNum2 = Integer.parseInt(unit2); } catch(NumberFormatException except) {

JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum2 = 0; } }while(uNum2 == 0); units += uNum2;

do//enter class code { try { code3 = JOptionPane.showInputDialog("Enter Class Code 3: "); JOptionPane.showMessageDialog(null,"You have entered: "+code3,"Enter",JOptionPane.WARNING_MESSAGE); cCode3 = Integer.parseInt(code3); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode3 = 0; } }while(cCode3 == 0);

subj3 = JOptionPane.showInputDialog("Enter Subject Name 3: ");//enter subject JOptionPane.showMessageDialog(null,"You have entered: "+subj3,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter unit { try { unit3 = JOptionPane.showInputDialog("Enter Unit 3: "); JOptionPane.showMessageDialog(null,"You have entered: "+unit3,"Enter",JOptionPane.WARNING_MESSAGE); uNum3 = Integer.parseInt(unit3); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum3 = 0; } }while(uNum3 == 0); units += uNum3;

do//enter number of lab subjects { try { setLoop = 1; numLab = JOptionPane.showInputDialog("Number of Lab Subjects: ");

JOptionPane.showMessageDialog(null,"You have entered: "+numLab,"Enter",JOptionPane.WARNING_MESSAGE); nLab = Integer.parseInt(numLab); while(nLab > 3) { JOptionPane.showMessageDialog(null,"You have exceeded total number of subjects. Please try again.","Enter",JOptionPane.WARNING_MESSAGE); numLab = JOptionPane.showInputDialog("Number of Lab Subjects: "); JOptionPane.showMessageDialog(null,"You have entered: "+numLab,"Enter",JOptionPane.WARNING_MESSAGE); nLab = Integer.parseInt(numLab); } } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0);

y += 1;//enter setting array index lFee *= nLab;//compute tuition fee units *= 2000; tFee = lFee + units + mFee; stud[y] = new Students(stNum, in2, cCode1, cCode2, cCode3, uNum1, uNum2, uNum3, subj1, subj2, subj3, nLab, tFee);//entering values

//displaying inputs studNum.setText("" + stNum); studName.setText(in2); classCodeone.setText("" + cCode1); unitNumone.setText("" + uNum1); subjNameone.setText(subj1); classCodetwo.setText("" + cCode2); unitNumtwo.setText("" + uNum2); subjNametwo.setText(subj2); classCodethree.setText("" + cCode3); unitNumthree.setText("" + uNum3); subjNamethree.setText(subj3); labSubj.setText("" + nLab); tuition.setText("" + tFee); } } private class ButtonHandler1 implements ActionListener { public void actionPerformed(ActionEvent e) { units = 0; do { try//search a student by student number {

setLoop = 1; inSearch = JOptionPane.showInputDialog("Search Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+inSearch,"Enter",JOptionPane.WARNING_MESSAGE); searchNum = Integer.parseInt(inSearch); for(int x=0; x<=y ;x++) {

if(searchNum == stud[x].studNum) //display search values { studentSearch.setText("" + stud[x].studNum); searchName.setText(stud[x].studName); classSearchone.setText("" + stud[x].classCode1); unitSearchone.setText("" + stud[x].units1); subjSearchone.setText(stud[x].subjName1); classSearchtwo.setText("" + stud[x].classCode2); unitSearchtwo.setText("" + stud[x].units2); subjSearchtwo.setText(stud[x].subjName2); classSearchthree.setText("" + stud[x].classCode3);

unitSearchthree.setText("" + stud[x].units3); subjSearchthree.setText(stud[x].subjName3); labSearch.setText("" + stud[x].numLab); tuitionSearch.setText("" + stud[x].tuitionFee); } } } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0); } }

private class ButtonHandler3 implements ActionListener { public void actionPerformed(ActionEvent e) { do { try//search a student by student number

{ setLoop = 1; inSearch = JOptionPane.showInputDialog("Search Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+inSearch,"Enter",JOptionPane.WARNING_MESSAGE); searchNum = Integer.parseInt(inSearch); for(int z=0; z<=y ;z++) {

if(searchNum == stud[z].studNum) { do//enter student number { try { setLoop = 1; in1 = JOptionPane.showInputDialog("Enter Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+in1,"Enter",JOptionPane.WARNING_MESSAGE); stNum = Integer.parseInt(in1); if(stNum != stud[z].studNum) { for(int x=0; x<=y ;x++) { while(stNum == stud[x].studNum) {

JOptionPane.showMessageDialog(null,"Student number already exists","Enter",JOptionPane.WARNING_MESSAGE); in1 = JOptionPane.showInputDialog("Enter Student Number: "); JOptionPane.showMessageDialog(null,"You have entered: "+in1,"Enter",JOptionPane.WARNING_MESSAGE); stNum = Integer.parseInt(in1);

} } } } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again. ","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0); in2 = JOptionPane.showInputDialog("Enter Name: "); JOptionPane.showMessageDialog(null,"You have entered:"+in2,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter class code { try {

code1 = JOptionPane.showInputDialog("Enter Class Code 1: "); JOptionPane.showMessageDialog(null,"You have entered: "+code1,"Enter",JOptionPane.WARNING_MESSAGE); cCode1 = Integer.parseInt(code1); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode1 = 0; } }while(cCode1 == 0);

subj1 = JOptionPane.showInputDialog("Enter Subject Name 1: ");//enter subject JOptionPane.showMessageDialog(null,"You have entered: "+subj1,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter unit { try { unit1 = JOptionPane.showInputDialog("Enter Unit 1: "); JOptionPane.showMessageDialog(null,"You have entered: "+unit1,"Enter",JOptionPane.WARNING_MESSAGE); uNum1 = Integer.parseInt(unit1); }

catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum1 = 0; } }while(uNum1 == 0); units += uNum1;

do//enter class code { try { code2 = JOptionPane.showInputDialog("Enter Class Code 2: "); JOptionPane.showMessageDialog(null,"You have entered: "+code2,"Enter",JOptionPane.WARNING_MESSAGE); cCode2 = Integer.parseInt(code2); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode2 = 0; } }while(cCode2 == 0);

subj2 = JOptionPane.showInputDialog("Enter Subject Name 2: ");//enter subject JOptionPane.showMessageDialog(null,"You have entered: "+subj2,"Enter",JOptionPane.WARNING_MESSAGE);

do { try { unit2 = JOptionPane.showInputDialog("Enter Unit 2: ");//enter units JOptionPane.showMessageDialog(null,"You have entered: "+unit2,"Enter",JOptionPane.WARNING_MESSAGE); uNum2 = Integer.parseInt(unit2); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum2 = 0; } }while(uNum2 == 0); units += uNum2;

do//enter class code { try {

code3 = JOptionPane.showInputDialog("Enter Class Code 3: "); JOptionPane.showMessageDialog(null,"You have entered: "+code3,"Enter",JOptionPane.WARNING_MESSAGE); cCode3 = Integer.parseInt(code3); } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); cCode3 = 0; } }while(cCode3 == 0);

subj3 = JOptionPane.showInputDialog("Enter Subject Name 3: ");//enter subject JOptionPane.showMessageDialog(null,"You have entered: "+subj3,"Enter",JOptionPane.WARNING_MESSAGE);

do//enter unit { try { unit3 = JOptionPane.showInputDialog("Enter Unit 3: "); JOptionPane.showMessageDialog(null,"You have entered: "+unit3,"Enter",JOptionPane.WARNING_MESSAGE); uNum3 = Integer.parseInt(unit3); }

catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); uNum3 = 0; } }while(uNum3 == 0); units += uNum3;

do//enter number of lab subjects { try { setLoop = 1; numLab = JOptionPane.showInputDialog("Number of Lab Subjects: "); JOptionPane.showMessageDialog(null,"You have entered: "+numLab,"Enter",JOptionPane.WARNING_MESSAGE); nLab = Integer.parseInt(numLab); while(nLab > 3) { JOptionPane.showMessageDialog(null,"You have exceeded total number of subjects. Please try again.","Enter",JOptionPane.WARNING_MESSAGE); numLab = JOptionPane.showInputDialog("Number of Lab Subjects: "); JOptionPane.showMessageDialog(null,"You have entered: "+numLab,"Enter",JOptionPane.WARNING_MESSAGE); nLab = Integer.parseInt(numLab);

} } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0);

lFee *= nLab;//compute tuition fee units *= 2000; tFee = lFee + units + mFee; stud[z] = new Students(stNum, in2, cCode1, cCode2, cCode3, uNum1, uNum2, uNum3, subj1, subj2, subj3, nLab, tFee);//entering values

//displaying inputs studNum.setText("" + stNum); studName.setText(in2); classCodeone.setText("" + cCode1); unitNumone.setText("" + uNum1); subjNameone.setText(subj1); classCodetwo.setText("" + cCode2); unitNumtwo.setText("" + uNum2); subjNametwo.setText(subj2); classCodethree.setText("" + cCode3); unitNumthree.setText("" + uNum3);

subjNamethree.setText(subj3); labSubj.setText("" + nLab); tuition.setText("" + tFee); } } } catch(NumberFormatException except) { JOptionPane.showMessageDialog(null,"Input Error! Input again.","Enter",JOptionPane.WARNING_MESSAGE); setLoop = 0; } }while(setLoop == 0); } } public static void main(String args[]) { Registration test = new Registration(); } }

Вам также может понравиться