Hi!
I need a little help .....
![]()
I have a problem with the method showMessageDialog belonging to JOptionPane's class.
I used this method to menage an event (in particular a button event). This is the code I used:
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand() == "View")
{
String output = "Credits: " + "200" ;
JOptionPane.showMessageDialog(null, output , "Status", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
}
The result is an empty pane with the only button "OK".
Neither the String I passed as parameter nor the icon "I" (because it is an INFORMATION_MESSAGE the icon is just an "I") was displayed....![]()
So I tried to run the exclusive JOptionPane.showMessageDialog code in another new file and it works correctly....
What do I wrong?![]()
Thanks for your support.
Bye!!![]()


Reply With Quote



Bookmarks