Я пытаюсь показать диалоговое окно сообщения с использованием Swing, показывающее, что введенный мной пароль не совпадает с паролем, хранящимся в массиве, но выдает ошибку:
incomplete types:<anonymous ActionListener> cannot be converted to component
Когда я использую this
заявление:
jRadioButton3.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
Manager[] arr = new Manager[3];
arr[c].setEmpID(Integer.valueOf(jTextField1.getText()));
arr[c].setEmpName(jTextField2.getText());
arr[c].setPassword(jTextField5.getText());
if (!arr[c].getPassword().equals(jTextField4.getText())) {
JOptionPane.showMessageDialog(this, "Invalid Password", "Error", JOptionPane.ERROR_MESSAGE);
}
}
});