|
confirmButton.setBounds(new Rectangle(115, 215, 65, 25));
confirmButton.setText("确认");
confirmButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent arg0) {
// TODO 自动生成方法存根
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, "请选择机器号!", "警告",
JOptionPane.WARNING_MESSAGE, null);
return;
}
if (cardId == null || cardId.length() == 0) {
JOptionPane.showMessageDialog(this, "请输入卡号!", "警告",
JOptionPane.WARNING_MESSAGE, null);
return;
}
if (passwordtemp == null || passwordtemp.length() == 0) {
JOptionPane.showMessageDialog(this, "请输入密码!", "警告",
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);
}});都是showMessageDialog处出错,说什么参数类型不适用。 |
|