Can't Find Symbol
Im new in java and this error makes me sick!
OptPane.showMessageDialog("...","...",OptPane.ERROR_MESSAGE);
What is wrong here?
And here is the declaration for OptPane:
private javax.swing.JOptionPane OptPane;
Im new in java and this error makes me sick!
OptPane.showMessageDialog("...","...",OptPane.ERROR_MESSAGE);
What is wrong here?
And here is the declaration for OptPane:
private javax.swing.JOptionPane OptPane;
showMessageDialog is a static method. Also, showMessageDialog needs to be passed a reference to the parent component, or null:
import javax.swing.*;
...
JOptionPane.showMessageDialog(null, "...", "...", JOptionPane.ERROR_MESSAGE);
Message was edited by:
Hippolyte
> thanks I didnt know that I had to put null there
Then you should set a bookmark to the API: http://java.sun.com/javase/6/docs/api/
For example: [url=http://java.sun.com/javase/6/docs/api/javax/swing/JOptionPane.html#showMessageDialog(java.awt.Component,%20java.lang.Object,%20java.lang.String,%20int)]showMessageDialog[/url]