Jump to content

Java Question: Need Help

ExDreamer

Here is my java question.
 

Write a Java class named Employee. This class should have the following private instance variables:

  • an ID value
  • the name of a person associated with the Employee
  • a field to store a value for the annual salary
  • a field to store a reference to another Employee object (for the Employee’s boss, eventually)
Write methods with the following signatures:
  • a public constructor for the class that will insure that Employee objects always have a ID and name fields with the signature:
public Employee(int id, String name)
  • a method to calculate an Employee object’s salary field with the signature:

public double calAnnualSalary(double monthlySal, double allowances, double tax)

            Annual salary calculation:
Gross salary = 12 x monthlysal
Annual salary = [Gross salary + allowances]-[gross salary x     tax]
Note* - tax in percentage
  • a method to get an Employee object’s current salary field value with the signature:
public double getSalary( )
  • a method to set an Employee object’s field referencing another Employee object with the signature:
public void setBoss ( Employee boss )
  • a method to return a String identifying the field contents of an Employee with the signature
public String toString()
 
You also need to write a Java class named Boss. This class will make use of the Employee class created above. Your Boss class should have the following private instance variables:
  • a bossName
  • an array named employees in which to store Employee objects
  • an int field named count to store the number of Employees who the Boss has.
Write methods with the following signatures:
  • a public constructor for the class that will insure that Boss objects always have a name field with the signature.
public Boss( String name )
This constructor should also instantiate an array to store Employee objects (at least 60) and initialize the count of employee’s to 0. It should not initialize the array contents; just create the array.
  • An appropriate accessor method (for example: getBossName())
  • a method to add an Employee object to the array of Employees with the signature
public void hire( Employee emp )
This method should increase the count of Employees associated with the Boss as each Employee is added.
  • a method that will cause the Boss to hire a group of people. This method should have the signature
public void staffUp()
This method should create a number of Employee objects (at least 5) and then use the hire method to add them to the boss. You may use any names and id values you choose. One way to initialize a group of names to use would be to get them from an array that is initialized like:
 
String [] names = {"John", "Paul", "George", "Ringo", "Fred" };
You may use these names or any of your choosing and any technigue of your choosing to give each Employee a different name as an input parameter for your Employee constructor. Use any id values you choose.
  • a method to print out the Boss name followed by the names of the Employees who are managed by a Boss in an order different than they were added. This method should have the signature:
public void list()
 
You also need to write a BossEmployeeDemo class that contains a main() method. The main method for this class should:
1. create a single instance of the Boss class,
2. call the staffUp method on the Boss object
            - ask user to input Employee name and ID
3. call the list method on the Boss object
4. Be sure that you also invoke appropriate methods in Employee class when you need to hire a staff.

 

 
And here is my incomplete code.
 

 public class Employee {private int id;private String name;private double monthlySal;private double allowances;private double tax;private double annualSal;public Employee(){}public Employee(int id, String name){this.id=id;this.name=name;}public int getID(){      return id;   }   public double getmoSal(){      return monthlySal;   }   public double getAll(){      return allowances;   }   public double getTax(){      return tax;   }   public String getEmployeeName(){      return name;   }public int setID(int newid){      id=newid;   return id;   }   public double setmoSal(double newmonthlySal){      monthlySal=newmonthlySal;   return monthlySal;   }   public double setAll(double newallowances){      allowances=newallowances;   return allowances;   }   public double setTax(double newtax){      tax=newtax;   return tax;   }   public void setEmployeeName(String newname){      name=newname;      }public double calAnnualSalary(double monthlySal, double allowances, double tax){double grossSal = 12 * monthlySal;annualSal = (grossSal + allowances)-(grossSal * (tax/100));return annualSal;}public void toString(Employee[] emp, double grossSal, double annualSal){for(int i=0; i<emp.length; i++){System.out.println("Employee name: " + name + " Employee ID: " +id + "Gross salary: "+grossSal+ "Annual salary: " + annualSal);}}} 
public class Boss{   private String name;   private int[] employeeId = {};   private String BossName;   private String hire;   Employee emp = new Employee();   public Boss(){   }      public Boss(String name){   this.name=name;   }      public String getBossName(){      return BossName;   }    public void setBossName(String BossName){    this.BossName = BossName;  }   public void hire( Employee emp ){          }      public void staffUp(){      String [] names = {};   }      public void list(){   } }
import java.util.*;public class BossEmployeeDemo{   public static void main(String []args)   {   Scanner scan=new Scanner(System.in);      Boss demo = new Boss();   Employee emp = new Employee();       System.out.print("Please enter Number of Employee  : ");   int K=scan.nextInt();            Employee[]employeesList = new Employee[K]; //array to store number of employee         for(int i= 0; i < employeesList.length;i++)           {            employeesList[i] = new Employee();                             System.out.print("Enter employee's ID: ");                emp.setID(scan.nextInt());                System.out.print("Enter employee's name: ");                emp.setEmployeeName(scan.next());                System.out.print("Enter employee's monthly salary: RM ");                emp.setmoSal(scan.nextDouble());                System.out.print("Enter employee's allowance: RM ");                emp.setAll(scan.nextDouble());                System.out.print("Enter employee's tax in percentage: ");                emp.setTax(scan.nextDouble());                System.out.println("");                                System.out.println("Employee # " + emp.getID());                System.out.println("Employee Name: " + emp.getEmployeeName());                System.out.println("Employee Monthly Salary: RM" + emp.getmoSal());                System.out.println("Employee Allowance: RM" + emp.getAll());                System.out.println("Employee Tax: " + emp.getTax()+"%");                System.out.println("Employee Annual Salary: RM" +emp.calAnnualSalary(emp.getmoSal(),emp.getAll(),emp.getTax()));                System.out.println("");                                   }}}  

My problem is i am not sure what i should put in the BossEmployeeDemo class. Plus i believe i had make tonnes of error but i am not sure how to fix it. For example,in Boss class ,i have many method without a statement inside it. I not even sure what the question ask me to do tbh.

If anyone could guide me,then i would grateful.
Please do not be hard on me as i just learn java for few months.Thanks

 

/* * 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. */package projectdata;import javafx.scene.control.RadioButton;import javax.swing.table.DefaultTableModel;/** * * @author User */public class ProjectInterface extends javax.swing.JFrame {public LinkedList studentdata=new LinkedList();public String nama;public int noMatric;public int carryMark;public Student student;public int count =0;    /**     * Creates new form ProjectInterface     */    public ProjectInterface() {        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() {        jScrollPane1 = new javax.swing.JScrollPane();        jList1 = new javax.swing.JList();        buttonGroup1 = new javax.swing.ButtonGroup();        buttonGroup2 = new javax.swing.ButtonGroup();        buttonGroup3 = new javax.swing.ButtonGroup();        jPanel8 = new javax.swing.JPanel();        jScrollPane7 = new javax.swing.JScrollPane();        jTable1 = new javax.swing.JTable();        jLabel14 = new javax.swing.JLabel();        jTabbedPane1 = new javax.swing.JTabbedPane();        jPanel1 = new javax.swing.JPanel();        jTabbedPane4 = new javax.swing.JTabbedPane();        jPanel13 = new javax.swing.JPanel();        jPanel5 = new javax.swing.JPanel();        txtnama = new javax.swing.JTextField();        jLabel1 = new javax.swing.JLabel();        jLabel2 = new javax.swing.JLabel();        txtmatric = new javax.swing.JTextField();        jLabel3 = new javax.swing.JLabel();        txtmark = new javax.swing.JTextField();        jButton1 = new javax.swing.JButton();        jRadioButton3 = new javax.swing.JRadioButton();        jRadioButton4 = new javax.swing.JRadioButton();        textArea6 = new java.awt.TextArea();        jLabel18 = new javax.swing.JLabel();        jPanel14 = new javax.swing.JPanel();        jScrollPane5 = new javax.swing.JScrollPane();        textArea4 = new java.awt.TextArea();        jButton8 = new javax.swing.JButton();        jPanel15 = new javax.swing.JPanel();        jLabel10 = new javax.swing.JLabel();        jLabel11 = new javax.swing.JLabel();        jLabel12 = new javax.swing.JLabel();        addbetnama = new javax.swing.JTextField();        addbetmat = new javax.swing.JTextField();        addbetCM = new javax.swing.JTextField();        jButton9 = new javax.swing.JButton();        jLabel13 = new javax.swing.JLabel();        targetname = new javax.swing.JTextField();        jLabel17 = new javax.swing.JLabel();        jTabbedPane3 = new javax.swing.JTabbedPane();        jPanel2 = new javax.swing.JPanel();        jPanel3 = new javax.swing.JPanel();        jRadioButton1 = new javax.swing.JRadioButton();        jRadioButton2 = new javax.swing.JRadioButton();        jButton4 = new javax.swing.JButton();        jScrollPane3 = new javax.swing.JScrollPane();        textArea1 = new java.awt.TextArea();        jLabel15 = new javax.swing.JLabel();        jPanel4 = new javax.swing.JPanel();        jScrollPane4 = new javax.swing.JScrollPane();        textArea3 = new java.awt.TextArea();        jButton5 = new javax.swing.JButton();        jPanel12 = new javax.swing.JPanel();        jLabel8 = new javax.swing.JLabel();        deletenama = new javax.swing.JTextField();        jButton6 = new javax.swing.JButton();        jPanel11 = new javax.swing.JPanel();        jButton7 = new javax.swing.JButton();        jLabel9 = new javax.swing.JLabel();        deletenomatric = new javax.swing.JTextField();        jPanel16 = new javax.swing.JPanel();        jButton10 = new javax.swing.JButton();        jScrollPane6 = new javax.swing.JScrollPane();        textArea5 = new java.awt.TextArea();        jLabel7 = new javax.swing.JLabel();        jPanel6 = new javax.swing.JPanel();        jPanel7 = new javax.swing.JPanel();        jLabel4 = new javax.swing.JLabel();        jTextField4 = new javax.swing.JTextField();        jButton2 = new javax.swing.JButton();        jPanel10 = new javax.swing.JPanel();        jLabel6 = new javax.swing.JLabel();        jTextField6 = new javax.swing.JTextField();        jButton3 = new javax.swing.JButton();        jScrollPane2 = new javax.swing.JScrollPane();        textArea2 = new java.awt.TextArea();        jLabel19 = new javax.swing.JLabel();        jPanel9 = new javax.swing.JPanel();        jPanel17 = new javax.swing.JPanel();        jButton11 = new javax.swing.JButton();        jButton13 = new javax.swing.JButton();        textArea7 = new java.awt.TextArea();        jPanel18 = new javax.swing.JPanel();        jButton12 = new javax.swing.JButton();        jButton14 = new javax.swing.JButton();        jLabel5 = new javax.swing.JLabel();        jLabel16 = new javax.swing.JLabel();        jList1.setModel(new javax.swing.AbstractListModel() {            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };            public int getSize() { return strings.length; }            public Object getElementAt(int i) { return strings[i]; }        });        jScrollPane1.setViewportView(jList1);        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);        jPanel8.setLayout(jPanel8Layout);        jPanel8Layout.setHorizontalGroup(            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGap(0, 100, Short.MAX_VALUE)        );        jPanel8Layout.setVerticalGroup(            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGap(0, 100, Short.MAX_VALUE)        );        jTable1.setModel(new javax.swing.table.DefaultTableModel(            new Object [][] {                {null, null, null, null},                {null, null, null, null},                {null, null, null, null},                {null, null, null, null}            },            new String [] {                "Title 1", "Title 2", "Title 3", "Title 4"            }        ));        jScrollPane7.setViewportView(jTable1);        jLabel14.setText("jLabel14");        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);        jPanel5.setBackground(new java.awt.Color(204, 204, 204));        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Data", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 255))); // NOI18N        txtnama.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                txtnamaActionPerformed(evt);            }        });        jLabel1.setText("Student Name");        jLabel2.setText("Matric Number");        jLabel3.setText("Carry Mark");        txtmark.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                txtmarkActionPerformed(evt);            }        });        jButton1.setBackground(new java.awt.Color(255, 255, 255));        jButton1.setForeground(new java.awt.Color(0, 0, 255));        jButton1.setText("Insert Data");        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);        jPanel5.setLayout(jPanel5Layout);        jPanel5Layout.setHorizontalGroup(            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel5Layout.createSequentialGroup()                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jLabel1)                    .addComponent(jLabel2)                    .addComponent(jLabel3))                .addGap(25, 25, 25)                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)                    .addComponent(txtnama, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)                    .addComponent(txtmatric, javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(txtmark))                .addGap(0, 0, Short.MAX_VALUE))            .addGroup(jPanel5Layout.createSequentialGroup()                .addGap(19, 19, 19)                .addComponent(jButton1)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel5Layout.setVerticalGroup(            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel5Layout.createSequentialGroup()                .addGap(17, 17, 17)                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel1)                    .addComponent(txtnama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(18, 18, 18)                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel2)                    .addComponent(txtmatric, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(18, 18, 18)                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(txtmark, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                    .addComponent(jLabel3))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)                .addComponent(jButton1)                .addContainerGap())        );        buttonGroup1.add(jRadioButton3);        jRadioButton3.setText("Insert Last");        jRadioButton3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jRadioButton3ActionPerformed(evt);            }        });        buttonGroup1.add(jRadioButton4);        jRadioButton4.setText("Insert First");        jRadioButton4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jRadioButton4ActionPerformed(evt);            }        });        jLabel18.setForeground(new java.awt.Color(0, 51, 255));        jLabel18.setText("Successful Insert Data");        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);        jPanel13.setLayout(jPanel13Layout);        jPanel13Layout.setHorizontalGroup(            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(textArea6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)            .addGroup(jPanel13Layout.createSequentialGroup()                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel13Layout.createSequentialGroup()                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                            .addGroup(jPanel13Layout.createSequentialGroup()                                .addContainerGap()                                .addComponent(jRadioButton4)                                .addGap(137, 137, 137)                                .addComponent(jRadioButton3))                            .addGroup(jPanel13Layout.createSequentialGroup()                                .addGap(214, 214, 214)                                .addComponent(jLabel18)))                        .addGap(0, 195, Short.MAX_VALUE))                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                .addContainerGap())        );        jPanel13Layout.setVerticalGroup(            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel13Layout.createSequentialGroup()                .addContainerGap()                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jRadioButton4)                    .addComponent(jRadioButton3))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jLabel18)                .addGap(4, 4, 4)                .addComponent(textArea6, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE))        );        jTabbedPane4.addTab("Insert First & Last", jPanel13);        jScrollPane5.setViewportView(textArea4);        jButton8.setBackground(new java.awt.Color(255, 255, 255));        jButton8.setForeground(new java.awt.Color(0, 0, 255));        jButton8.setText("Display Data");        jButton8.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton8ActionPerformed(evt);            }        });        jPanel15.setBackground(new java.awt.Color(204, 204, 204));        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "New Data", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N        jLabel10.setText("Student Name         :");        jLabel11.setText("Matric Number         :");        jLabel12.setText("Carry Mark              :");        addbetnama.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                addbetnamaActionPerformed(evt);            }        });        jButton9.setBackground(new java.awt.Color(255, 255, 255));        jButton9.setForeground(new java.awt.Color(0, 0, 255));        jButton9.setText("Insert Data");        jButton9.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton9ActionPerformed(evt);            }        });        jLabel13.setText("Enter Target Name : ");        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);        jPanel15.setLayout(jPanel15Layout);        jPanel15Layout.setHorizontalGroup(            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel15Layout.createSequentialGroup()                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jLabel10)                    .addComponent(jLabel11)                    .addComponent(jLabel12)                    .addComponent(jLabel13))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                    .addComponent(addbetmat, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)                    .addComponent(addbetnama, javax.swing.GroupLayout.Alignment.TRAILING)                    .addComponent(targetname, javax.swing.GroupLayout.Alignment.TRAILING)                    .addComponent(addbetCM)))            .addGroup(jPanel15Layout.createSequentialGroup()                .addGap(30, 30, 30)                .addComponent(jButton9)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel15Layout.setVerticalGroup(            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel15Layout.createSequentialGroup()                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                    .addGroup(jPanel15Layout.createSequentialGroup()                        .addComponent(jLabel13)                        .addGap(12, 12, 12))                    .addGroup(jPanel15Layout.createSequentialGroup()                        .addComponent(targetname)                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel10)                    .addComponent(addbetnama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel11)                    .addComponent(addbetmat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)                    .addComponent(jLabel12)                    .addComponent(addbetCM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jButton9)                .addContainerGap(23, Short.MAX_VALUE))        );        jLabel17.setForeground(new java.awt.Color(0, 51, 204));        jLabel17.setText("All Information");        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);        jPanel14.setLayout(jPanel14Layout);        jPanel14Layout.setHorizontalGroup(            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel14Layout.createSequentialGroup()                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)                .addGap(44, 44, 44))            .addGroup(jPanel14Layout.createSequentialGroup()                .addComponent(jButton8)                .addGap(106, 106, 106)                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))            .addGroup(jPanel14Layout.createSequentialGroup()                .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addContainerGap())        );        jPanel14Layout.setVerticalGroup(            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel14Layout.createSequentialGroup()                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel14Layout.createSequentialGroup()                        .addGap(7, 7, 7)                        .addComponent(jButton8))                    .addGroup(jPanel14Layout.createSequentialGroup()                        .addContainerGap(22, Short.MAX_VALUE)                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)                        .addGap(3, 3, 3)))                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(15, 15, 15))        );        jTabbedPane4.addTab("Insert in Between two Data", jPanel14);        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);        jPanel1.setLayout(jPanel1Layout);        jPanel1Layout.setHorizontalGroup(            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()                .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 532, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(0, 0, Short.MAX_VALUE))        );        jPanel1Layout.setVerticalGroup(            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jTabbedPane4, javax.swing.GroupLayout.Alignment.TRAILING)        );        jTabbedPane1.addTab("Insert Data", jPanel1);        buttonGroup1.add(jRadioButton1);        jRadioButton1.setText("Delete First");        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jRadioButton1ActionPerformed(evt);            }        });        buttonGroup1.add(jRadioButton2);        jRadioButton2.setText("Delete Last");        jButton4.setBackground(new java.awt.Color(255, 255, 255));        jButton4.setForeground(new java.awt.Color(0, 0, 255));        jButton4.setText("Delete");        jButton4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton4ActionPerformed(evt);            }        });        jScrollPane3.setViewportView(textArea1);        jLabel15.setForeground(new java.awt.Color(0, 51, 255));        jLabel15.setText("Display New Information After Delete");        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);        jPanel3.setLayout(jPanel3Layout);        jPanel3Layout.setHorizontalGroup(            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel3Layout.createSequentialGroup()                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jRadioButton1)                    .addComponent(jRadioButton2)                    .addGroup(jPanel3Layout.createSequentialGroup()                        .addComponent(jButton4)                        .addGap(97, 97, 97)                        .addComponent(jLabel15))                    .addGroup(jPanel3Layout.createSequentialGroup()                        .addContainerGap()                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 446, javax.swing.GroupLayout.PREFERRED_SIZE)))                .addContainerGap(51, Short.MAX_VALUE))        );        jPanel3Layout.setVerticalGroup(            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel3Layout.createSequentialGroup()                .addComponent(jRadioButton1)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(jRadioButton2)                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel3Layout.createSequentialGroup()                        .addGap(18, 18, 18)                        .addComponent(jButton4)                        .addGap(18, 18, 18)                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE))                    .addGroup(jPanel3Layout.createSequentialGroup()                        .addGap(38, 38, 38)                        .addComponent(jLabel15)))                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);        jPanel2.setLayout(jPanel2Layout);        jPanel2Layout.setHorizontalGroup(            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addContainerGap())        );        jPanel2Layout.setVerticalGroup(            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel2Layout.createSequentialGroup()                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(0, 0, Short.MAX_VALUE))        );        jTabbedPane3.addTab("Delete First and Last", jPanel2);        jScrollPane4.setViewportView(textArea3);        jButton5.setBackground(new java.awt.Color(255, 255, 255));        jButton5.setForeground(new java.awt.Color(0, 0, 255));        jButton5.setText("Display Data To Delete");        jButton5.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton5ActionPerformed(evt);            }        });        jPanel12.setBackground(new java.awt.Color(204, 204, 204));        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Find by Student Name", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N        jLabel8.setText(" Student Name");        jButton6.setBackground(new java.awt.Color(255, 255, 255));        jButton6.setForeground(new java.awt.Color(0, 0, 255));        jButton6.setText("Delete");        jButton6.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton6ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);        jPanel12.setLayout(jPanel12Layout);        jPanel12Layout.setHorizontalGroup(            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel12Layout.createSequentialGroup()                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel12Layout.createSequentialGroup()                        .addComponent(jLabel8)                        .addGap(30, 30, 30)                        .addComponent(deletenama))                    .addComponent(jButton6))                .addGap(43, 43, 43))        );        jPanel12Layout.setVerticalGroup(            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel12Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel8)                    .addComponent(deletenama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(18, 18, 18)                .addComponent(jButton6))        );        jPanel11.setBackground(new java.awt.Color(204, 204, 204));        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Find By Matric Number", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 255))); // NOI18N        jButton7.setBackground(new java.awt.Color(255, 255, 255));        jButton7.setForeground(new java.awt.Color(0, 0, 255));        jButton7.setText("Delete");        jButton7.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton7ActionPerformed(evt);            }        });        jLabel9.setText("Matric Number");        deletenomatric.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                deletenomatricActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);        jPanel11.setLayout(jPanel11Layout);        jPanel11Layout.setHorizontalGroup(            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel11Layout.createSequentialGroup()                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jButton7)                    .addGroup(jPanel11Layout.createSequentialGroup()                        .addComponent(jLabel9)                        .addGap(37, 37, 37)                        .addComponent(deletenomatric, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)))                .addGap(21, 21, 21))        );        jPanel11Layout.setVerticalGroup(            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel9)                    .addComponent(deletenomatric, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addGap(18, 18, 18)                .addComponent(jButton7))        );        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);        jPanel4.setLayout(jPanel4Layout);        jPanel4Layout.setHorizontalGroup(            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel4Layout.createSequentialGroup()                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jPanel12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING)                    .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                .addContainerGap())            .addGroup(jPanel4Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jButton5)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel4Layout.setVerticalGroup(            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel4Layout.createSequentialGroup()                .addGap(7, 7, 7)                .addComponent(jButton5)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(39, 39, 39))        );        jTabbedPane3.addTab("Delete Between", jPanel4);        jTabbedPane1.addTab("Delete Data", jTabbedPane3);        jButton10.setBackground(new java.awt.Color(255, 255, 255));        jButton10.setForeground(new java.awt.Color(0, 0, 255));        jButton10.setText("Display");        jButton10.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton10ActionPerformed(evt);            }        });        jScrollPane6.setViewportView(textArea5);        jLabel7.setForeground(new java.awt.Color(0, 51, 255));        jLabel7.setText("Display All Information");        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);        jPanel16.setLayout(jPanel16Layout);        jPanel16Layout.setHorizontalGroup(            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel16Layout.createSequentialGroup()                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addGroup(jPanel16Layout.createSequentialGroup()                        .addGap(18, 18, 18)                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 504, Short.MAX_VALUE))                    .addGroup(jPanel16Layout.createSequentialGroup()                        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                            .addGroup(jPanel16Layout.createSequentialGroup()                                .addContainerGap()                                .addComponent(jButton10))                            .addGroup(jPanel16Layout.createSequentialGroup()                                .addGap(207, 207, 207)                                .addComponent(jLabel7)))                        .addGap(0, 0, Short.MAX_VALUE)))                .addContainerGap())        );        jPanel16Layout.setVerticalGroup(            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel16Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jButton10)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 462, javax.swing.GroupLayout.PREFERRED_SIZE))        );        jTabbedPane1.addTab("Display Data", jPanel16);        jPanel7.setBackground(new java.awt.Color(204, 204, 204));        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search by Student Name", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 204))); // NOI18N        jLabel4.setText("Student Name     :");        jButton2.setBackground(new java.awt.Color(255, 255, 255));        jButton2.setForeground(new java.awt.Color(0, 0, 255));        jButton2.setText("Search and Display");        jButton2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton2ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);        jPanel7.setLayout(jPanel7Layout);        jPanel7Layout.setHorizontalGroup(            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel7Layout.createSequentialGroup()                .addComponent(jButton2)                .addGap(0, 0, Short.MAX_VALUE))            .addGroup(jPanel7Layout.createSequentialGroup()                .addComponent(jLabel4)                .addGap(26, 26, 26)                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 403, javax.swing.GroupLayout.PREFERRED_SIZE)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel7Layout.setVerticalGroup(            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel7Layout.createSequentialGroup()                .addContainerGap()                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel4)                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)                .addComponent(jButton2))        );        jPanel10.setBackground(new java.awt.Color(204, 204, 204));        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search by Matric Number", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 255))); // NOI18N        jLabel6.setText("Matric Number    :");        jButton3.setBackground(new java.awt.Color(255, 255, 255));        jButton3.setForeground(new java.awt.Color(0, 0, 255));        jButton3.setText("Search and Display");        jButton3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton3ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);        jPanel10.setLayout(jPanel10Layout);        jPanel10Layout.setHorizontalGroup(            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jButton3)            .addGroup(jPanel10Layout.createSequentialGroup()                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(18, 18, 18)                .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE))        );        jPanel10Layout.setVerticalGroup(            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel10Layout.createSequentialGroup()                .addContainerGap()                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel6)                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)                .addComponent(jButton3))        );        jScrollPane2.setViewportView(textArea2);        jLabel19.setForeground(new java.awt.Color(0, 51, 204));        jLabel19.setText("Display Information");        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);        jPanel6.setLayout(jPanel6Layout);        jPanel6Layout.setHorizontalGroup(            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel6Layout.createSequentialGroup()                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                    .addComponent(jScrollPane2)                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)                    .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                .addContainerGap())            .addGroup(jPanel6Layout.createSequentialGroup()                .addGap(227, 227, 227)                .addComponent(jLabel19)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel6Layout.setVerticalGroup(            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel6Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(31, 31, 31)                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))        );        jTabbedPane1.addTab("Search Data", jPanel6);        jPanel17.setBackground(new java.awt.Color(204, 204, 204));        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Sort by Matric Number", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 255))); // NOI18N        jButton11.setBackground(new java.awt.Color(255, 255, 255));        jButton11.setForeground(new java.awt.Color(0, 0, 255));        jButton11.setText("Sort With Ascending Order and Display All Data");        jButton11.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton11ActionPerformed(evt);            }        });        jButton13.setBackground(new java.awt.Color(0, 204, 255));        jButton13.setText("Sort With Descending Order and Display All Data");        jButton13.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton13ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);        jPanel17.setLayout(jPanel17Layout);        jPanel17Layout.setHorizontalGroup(            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel17Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                    .addComponent(jButton11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                    .addComponent(jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE))                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel17Layout.setVerticalGroup(            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel17Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(18, 18, 18)                .addComponent(jButton13)                .addContainerGap())        );        jPanel18.setBackground(new java.awt.Color(204, 204, 204));        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Sort by Student Name", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 51, 204))); // NOI18N        jButton12.setBackground(new java.awt.Color(255, 255, 255));        jButton12.setForeground(new java.awt.Color(0, 0, 255));        jButton12.setText("Sort With Ascending Order and Display All Data");        jButton12.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton12ActionPerformed(evt);            }        });        jButton14.setBackground(new java.awt.Color(0, 204, 204));        jButton14.setText("Sort With  Descending Order and Display All Data");        jButton14.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton14ActionPerformed(evt);            }        });        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);        jPanel18.setLayout(jPanel18Layout);        jPanel18Layout.setHorizontalGroup(            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel18Layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                    .addComponent(jButton14, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)                    .addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jPanel18Layout.setVerticalGroup(            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel18Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jButton12)                .addGap(25, 25, 25)                .addComponent(jButton14)                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))        );        jLabel5.setBackground(new java.awt.Color(153, 153, 0));        jLabel5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N        jLabel5.setForeground(new java.awt.Color(0, 0, 255));        jLabel5.setText("OUTPUT");        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);        jPanel9.setLayout(jPanel9Layout);        jPanel9Layout.setHorizontalGroup(            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(textArea7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)            .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()                .addContainerGap(221, Short.MAX_VALUE)                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(219, 219, 219))            .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)        );        jPanel9Layout.setVerticalGroup(            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(jPanel9Layout.createSequentialGroup()                .addContainerGap()                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                .addGap(14, 14, 14)                .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addComponent(textArea7, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))        );        jTabbedPane1.addTab("Sort", jPanel9);        jLabel16.setForeground(new java.awt.Color(0, 0, 255));        jLabel16.setText("Registration System Of Continuous Assessment");        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());        getContentPane().setLayout(layout);        layout.setHorizontalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addComponent(jTabbedPane1)            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                .addComponent(jLabel16)                .addGap(133, 133, 133))        );        layout.setVerticalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(8, 8, 8)                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 538, Short.MAX_VALUE))        );        pack();    }// </editor-fold>                            private void txtnamaActionPerformed(java.awt.event.ActionEvent evt) {                                                // TODO add your handling code here:    }                                           private void jRadioButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                                      // TODO add your handling code here:            }                                                 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:                int row=1;        count++;       int loop=0;        if(jRadioButton3.isSelected()){          nama= txtnama.getText();            noMatric=Integer.parseInt(txtmatric.getText());            carryMark=Integer.parseInt(txtmark.getText());            student= new Student(nama, noMatric, carryMark);         studentdata.addLast(student);                   while(loop<count+1){     textArea6.setText(studentdata.traver());                                           loop++;       }        }else{                     nama= txtnama.getText();            noMatric=Integer.parseInt(txtmatric.getText());            carryMark=Integer.parseInt(txtmark.getText());            student= new Student(nama, noMatric, carryMark);         studentdata.addFirst(student);                      while(loop<count){     textArea6.setText(studentdata.traver());                loop++;         }                 }    }                                            private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                                          }                                                 private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                              //         }                                                 private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:        String Tnama;        Tnama=targetname.getText();        nama=addbetnama.getText();        noMatric=Integer.parseInt(addbetmat.getText());        carryMark=Integer.parseInt(addbetCM.getText());        student= new Student(nama, noMatric, carryMark);        studentdata.addBetweenbehindlinkedlist(Tnama, student);        textArea4.setText(studentdata.traver());    }                                            private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:        textArea4.setText(studentdata.traver());    }                                            private void addbetnamaActionPerformed(java.awt.event.ActionEvent evt) {                                                   // TODO add your handling code here:    }                                              private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {                                                  // TODO add your handling code here:        textArea5.setText(studentdata.traver());    }                                             private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:         int row=1;        count++;       int loop=0;        if(jRadioButton1.isSelected()){                  studentdata.removeFirst();         textArea1.setText(studentdata.traver());               }        else{                              studentdata.removeLast();              textArea1.setText(studentdata.traver());            }    }                                            private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:        textArea3.setText(studentdata.traver());    }                                            private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:        String delnama=deletenama.getText();        studentdata.removeBetweenlinkedlist(delnama);        textArea3.setText(studentdata.traver());    }                                            private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:        int delNoMat=Integer.parseInt(deletenomatric.getText());        studentdata.removeBetweenlinkedlistint(delNoMat);        textArea3.setText(studentdata.traver());    }                                            private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                              String namasea= jTextField4.getText();        textArea2.setText(studentdata.displaysearch(namasea));    }                                            private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                                 // TODO add your handling code here:         int namasea= Integer.parseInt(jTextField6.getText());        textArea2.setText(studentdata.nomatrix(namasea));    }                                            private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {                                                  // TODO add your handling code here:                textArea7.setText(studentdata.secondsort());        //textArea7.setText(studentdata.traver());    }                                             private void txtmarkActionPerformed(java.awt.event.ActionEvent evt) {                                                // TODO add your handling code here:    }                                           private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {                                                  // TODO add your handling code here:        textArea7.setText(studentdata.secondsortbyname());    }                                             private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {                                                  // TODO add your handling code here:        textArea7.setText(studentdata.secondsortmenurun());    }                                             private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {                                                  // TODO add your handling code here:        textArea7.setText(studentdata.secondsortbynamemenurun());    }                                             private void deletenomatricActionPerformed(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(ProjectInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);        } catch (InstantiationException ex) {            java.util.logging.Logger.getLogger(ProjectInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);        } catch (IllegalAccessException ex) {            java.util.logging.Logger.getLogger(ProjectInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);        } catch (javax.swing.UnsupportedLookAndFeelException ex) {            java.util.logging.Logger.getLogger(ProjectInterface.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 ProjectInterface().setVisible(true);            }        });    }    // Variables declaration - do not modify                         private javax.swing.JTextField addbetCM;    private javax.swing.JTextField addbetmat;    private javax.swing.JTextField addbetnama;    private javax.swing.ButtonGroup buttonGroup1;    private javax.swing.ButtonGroup buttonGroup2;    private javax.swing.ButtonGroup buttonGroup3;    private javax.swing.JTextField deletenama;    private javax.swing.JTextField deletenomatric;    private javax.swing.JButton jButton1;    private javax.swing.JButton jButton10;    private javax.swing.JButton jButton11;    private javax.swing.JButton jButton12;    private javax.swing.JButton jButton13;    private javax.swing.JButton jButton14;    private javax.swing.JButton jButton2;    private javax.swing.JButton jButton3;    private javax.swing.JButton jButton4;    private javax.swing.JButton jButton5;    private javax.swing.JButton jButton6;    private javax.swing.JButton jButton7;    private javax.swing.JButton jButton8;    private javax.swing.JButton jButton9;    private javax.swing.JLabel jLabel1;    private javax.swing.JLabel jLabel10;    private javax.swing.JLabel jLabel11;    private javax.swing.JLabel jLabel12;    private javax.swing.JLabel jLabel13;    private javax.swing.JLabel jLabel14;    private javax.swing.JLabel jLabel15;    private javax.swing.JLabel jLabel16;    private javax.swing.JLabel jLabel17;    private javax.swing.JLabel jLabel18;    private javax.swing.JLabel jLabel19;    private javax.swing.JLabel jLabel2;    private javax.swing.JLabel jLabel3;    private javax.swing.JLabel jLabel4;    private javax.swing.JLabel jLabel5;    private javax.swing.JLabel jLabel6;    private javax.swing.JLabel jLabel7;    private javax.swing.JLabel jLabel8;    private javax.swing.JLabel jLabel9;    private javax.swing.JList jList1;    private javax.swing.JPanel jPanel1;    private javax.swing.JPanel jPanel10;    private javax.swing.JPanel jPanel11;    private javax.swing.JPanel jPanel12;    private javax.swing.JPanel jPanel13;    private javax.swing.JPanel jPanel14;    private javax.swing.JPanel jPanel15;    private javax.swing.JPanel jPanel16;    private javax.swing.JPanel jPanel17;    private javax.swing.JPanel jPanel18;    private javax.swing.JPanel jPanel2;    private javax.swing.JPanel jPanel3;    private javax.swing.JPanel jPanel4;    private javax.swing.JPanel jPanel5;    private javax.swing.JPanel jPanel6;    private javax.swing.JPanel jPanel7;    private javax.swing.JPanel jPanel8;    private javax.swing.JPanel jPanel9;    private javax.swing.JRadioButton jRadioButton1;    private javax.swing.JRadioButton jRadioButton2;    private javax.swing.JRadioButton jRadioButton3;    private javax.swing.JRadioButton jRadioButton4;    private javax.swing.JScrollPane jScrollPane1;    private javax.swing.JScrollPane jScrollPane2;    private javax.swing.JScrollPane jScrollPane3;    private javax.swing.JScrollPane jScrollPane4;    private javax.swing.JScrollPane jScrollPane5;    private javax.swing.JScrollPane jScrollPane6;    private javax.swing.JScrollPane jScrollPane7;    private javax.swing.JTabbedPane jTabbedPane1;    private javax.swing.JTabbedPane jTabbedPane3;    private javax.swing.JTabbedPane jTabbedPane4;    private javax.swing.JTable jTable1;    private javax.swing.JTextField jTextField4;    private javax.swing.JTextField jTextField6;    private javax.swing.JTextField targetname;    private java.awt.TextArea textArea1;    private java.awt.TextArea textArea2;    private java.awt.TextArea textArea3;    private java.awt.TextArea textArea4;    private java.awt.TextArea textArea5;    private java.awt.TextArea textArea6;    private java.awt.TextArea textArea7;    private javax.swing.JTextField txtmark;    private javax.swing.JTextField txtmatric;    private javax.swing.JTextField txtnama;    // End of variables declaration                   }
Link to comment
Share on other sites

Link to post
Share on other sites

I'll take a closer look at this later, but right off the bat I noticed that it wants you to have private instance variables. You left almost all of them as public.

[spoiler=My Current PC]AMD FX-8320 @ 4.2 Ghz | Xigmatek Dark Knight Night Hawk II | Gigabyte GA-990FXA-UD3 | 8GB Adata XPG V2 Silver 1600 Mhz RAM | Gigabyte 3X Windforce GTX 770 4GB @ 1.27 Ghz/7.25 Ghz | Rosewill Hive 550W Bronze PSU | Fractal Design Arc Midi R2 | Samsung Evo 250 GB SSD | Seagate Barracuda 1TB HDD | ASUS VS239H-P | Razer Deathadder 2013 Partlist

 

LTT Build-Off Thread: http://linustechtips.com/main/topic/35226-the-ltt-build-off-thread-no-building-required/

Link to comment
Share on other sites

Link to post
Share on other sites

I'll take a closer look at this later, but right off the bat I noticed that it wants you to have private instance variables. You left almost all of them as public.

Thanks,i have edit the code to represent that.

Link to comment
Share on other sites

Link to post
Share on other sites

I can understand how you can be confused on some parts (because in my opinion the wording is contradictory of what is being ask later on).  Anyways here is the stuff I can answer.

For the boss your emp need to be an array, and your employeeId array should actually be a simple int, and probably renamed to employee count.

For the boss constructor it asks you to initialize the employee array, which means you are missing these lines in the constructor

employeeCount = 0;emp = new Employee[60];

The list array should be simpler.  It is basically asking you to list off the bosses name and then list the employees (but not in the order they were added).  You could get away with display all the odds first then all the evens...something like

int index;for(index = 0; index < employeeCount; index+=2) {Employee employee = emp[index]; //Do what you want, all even number employees}for(index = 1; index < employeeCount; index+=2) { //same as above, but all odds this time}

Hire should be easy, you just insert the employee into the array at employeeCount and then increment it.  No implementation code because I will let you figure that out, because it should be very simple (2 lines of code). (Actually if you are daring 1 line of code...but that might be less readable for you at the moment).

 

Now for the staffUp.  I think the assignment is very poorly worded, for this.  It asks you to use staffUp later on and expects the user to fill in the information?  Yet staffUp is suppose to fill it in automatically?  To me it sounds contrary.  Anyways assuming it is actually suppose to ask user information then you can roughly use your for loop.

///For loop run 5 or more times                //Pulled from your code                Employee emp  = new Employee();                System.out.print("Enter employee's ID: ");                emp.setID(scan.nextInt());                System.out.print("Enter employee's name: ");                emp.setEmployeeName(scan.next());                System.out.print("Enter employee's monthly salary: RM ");                emp.setmoSal(scan.nextDouble());                System.out.print("Enter employee's allowance: RM ");                emp.setAll(scan.nextDouble());                System.out.print("Enter employee's tax in percentage: ");                emp.setTax(scan.nextDouble());                //Added code to add to array                hire(emp);

This means in the demo, you create a boss, then just have to call the staffUp x amount of times and each call you will add n amount of employees.

 

Then you just call the list function.

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×