java - Can't get a Message Dialog box to come from an Action Listener -
This question is already an answer here Is:
- 1 answer
I I am receiving an error message as a result of an action listener in my program that receives an error that can not be changed to 'incompatible source code-incompatible type: zero to java.lang.String'. I can not understand what I am doing, especially when I can get input dialog and confirm the dialog box as I want the message dialog box, using a lot of code. Here is the code I used ...
// Search menu item srch.addActionListener (New ActionListener) {@Override Public Null ActionPerformed (ActionEvent e) {if (Database_Name =) Adding an ActionListener else if (Database_Name = null) {jta.setText ("this works");}; = null) {error = JOptionPane.showMessageDialog (zero, "error", JOptionPane.ERROR_MESSAGE) "This is an error Message? "}! // end if statement} // end actionPerformed}); // Find the end MENUITEM action listener
The error says just as, Error
variable is most likely a string
while does not return a value as
Code> (if database_name == null) {JOptionPane.showMessageDialog (null, "This is an error message", "Error", Joppanpan. ARROOS_OSSS); }
Will work fine.
Comments
Post a Comment