Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Where do I add the main method update the code so the user can look up an employ

ID: 3659707 • Letter: W

Question

Where do I add the main method update the code so the user can look up an employee and change the position and pay rate as well as add new employees? import javax.swing.*; import java.awt.*; public class PersonnelModPanel extends JPanel { private JTextField nameTextField; private JTextField rateTextField; public void NameRatePanel() { JLabel namePrompt = new JLabel("Employees Name"); nameTextField = new JTextField(10); JLabel ratePrompt = new JLabel("Pay Rate"); rateTextField = new JTextField(10); setLayout(new GridLayout(4, 1)); add (namePrompt); add (nameTextField); add (ratePrompt); add (rateTextField); } public int getEmployeesName() { return Integer.parseInt(nameTextField.getText()); } public String getrate() { return rateTextField.getText(); } public void clear() { nameTextField.setText(""); rateTextField.setText(""); } }

Explanation / Answer

/*This may help you*/

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

public class PersonnelModPanel extends JPanel {
    private JTextField nameTextField;
    private JTextField rateTextField;

    public void NameRatePanel() {
        JLabel namePrompt = new JLabel("Employees Name");
        nameTextField = new JTextField(10);
        JLabel ratePrompt = new JLabel("Pay Rate");
        rateTextField = new JTextField(10);
        setLayout(new GridLayout(4, 1));
        add(namePrompt);
        add(nameTextField);
        add(ratePrompt);
        add(rateTextField);
    }

    public int getEmployeesName() {
        return Integer.parseInt(nameTextField.getText());
    }

    public String getrate() {
        return rateTextField.getText();
    }

    public void clear() {
        nameTextField.setText("");
        rateTextField.setText("");
    }

    public static void main(String[] args) {
        PersonnelModPanel p = new PersonnelModPanel();
        p.NameRatePanel();
    }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote