sabi97
asked on
Swing Dialog Error
I'm adding the below event to a menu item, to trigger a dialog box.
------------
private void jMenuItem2ActionPerformed( java.awt.e vent.Actio nEvent evt) {
JOptionPane.showMessageDia log(null, "test dialog");
}
-------------
However, I'm getting the below errors!
------------------
forte4j/Development/db2.ja va [244:1] Undefined variable, class, or package name: JOptionPane
JOptionPane.showMessageDia log(null, "test dialog");
^
forte4j/Development/db2.ja va [244:1] Invalid expression statement.
JOptionPane.showMessageDia log(null, "test dialog");
^
---------------------
I'm adding other components to the JFrame like so :
getContentPane().add(searc hHeader);
How do I get the dialog to work?
------------
private void jMenuItem2ActionPerformed(
JOptionPane.showMessageDia
}
-------------
However, I'm getting the below errors!
------------------
forte4j/Development/db2.ja
JOptionPane.showMessageDia
^
forte4j/Development/db2.ja
JOptionPane.showMessageDia
^
---------------------
I'm adding other components to the JFrame like so :
getContentPane().add(searc
How do I get the dialog to work?
Did you import javax.swing.* ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Who said anything about jsp??
This question is LOCKED with a Proposed Answer. If it helps you, great, accept it and grade it to close. If not, reject it and comment as to why or what else is needed.
Few additional experts will join this collaboration effort, once a question has been locked. Just want to confirm this to you. If more than one expert helps you, you can always split points or award additional help in a new question, within the same topic area. If you need help from us, post a zero point question here, and include the link:
EXPERT INPUT ON OUTCOME ALWAYS WELCOME.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
Moondancer
Community Support Moderator @ Experts Exchange
Few additional experts will join this collaboration effort, once a question has been locked. Just want to confirm this to you. If more than one expert helps you, you can always split points or award additional help in a new question, within the same topic area. If you need help from us, post a zero point question here, and include the link:
EXPERT INPUT ON OUTCOME ALWAYS WELCOME.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
Moondancer
Community Support Moderator @ Experts Exchange
hi...
i have encountered the same problem too...
u need to add
import javax.swing.JOptionPane;
on the beginning of the file
hopes this solve the problem
jen
i have encountered the same problem too...
u need to add
import javax.swing.JOptionPane;
on the beginning of the file
hopes this solve the problem
jen
Please reject the proposed answer since it is a duplicate.
Thank you, yongsing: Please claim your points here, this topic area:
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20265815
Moondancer
Community Support Moderator @ Experts Exchange
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20265815
Moondancer
Community Support Moderator @ Experts Exchange