void HireFire_actionPerformed(ActionEvent e) { applicant selectedEmp; // employee selected by user from jList if (!appList.isEmpty()) { // Do what you wish the selected applicant selectedEmp = (applicant) jList1.getSelectedValue(); if (selectedEmp.Hired.equals("0")) Moo.send("hire " + selectedEmp.ApplicantID + " " + jTextFieldWage.getText()); else Moo.send("fire"); Moo.send("get_applicants " + jTextFieldWage.getText()); // refreshes list after changes } }
/** Default constructor for the demo. */ public Newspaper(MooConnection moo) throws Exception { this(); this.setVisible(true); Moo = moo; Moo.send("testnews"); // use Moo.send(String); to talk to moo // SwingUtilities.invokeLater(new Runnable() { // public void run() { // Newspaper app = new Newspaper(); // app.setVisible(true); // } // }); }
void jButtonAdvertise_actionPerformed(ActionEvent e) { Moo.send("get_applicants " + jTextFieldWage.getText()); }