|
confirmButton.setBounds (new Rectangle (115, 215, 65, 25));
confirmButton.setText ("Confirm");
confirmButton.addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent arg0) {
// TODO automatically generates method stubs
String cardId = "";
String passwordtemp = "";
String computerId = "";
cardId = cardIdTextField.getText (). trim ();
for (int i = 0; i <passwordFiled.getPassword (). length; i ++) {
passwordtemp + = passwordFiled.getPassword () [i];
}
computerId = computerIdCombox.getSelectedItem (). toString ();
if (computerId == null || computerId.trim (). length () == 0) {
JOptionPane.showMessageDialog (this, "Please select the machine number!", "Warning",
JOptionPane.WARNING_MESSAGE, null);
return;
}
if (cardId == null || cardId.length () == 0) {
JOptionPane.showMessageDialog (this, "Please enter the card number!", "Warning",
JOptionPane.WARNING_MESSAGE, null);
return;
}
if (passwordtemp == null || passwordtemp.length () == 0) {
JOptionPane.showMessageDialog (this, "Please enter a password!", "Warning",
JOptionPane.WARNING_MESSAGE, null);
return;
}
String dispalyNowTime = dispalyNowTimeTextField.getText () + ": 00";
WelcomePanel welcomePanel2 = new WelcomePanel ();
mainFrame.remove (mainFrame.getContentPane ());
mainFrame.getContentPane (). add (welcomePanel2);
mainFrame.setContentPane (welcomePanel2);
mainFrame.setVisible (true);
}}); It is an error at showMessageDialog, saying that the parameter type is not applicable. |
|