Hi,
I am using the Eclipse Visual Editor M1. I have the following JMenu:
==
private JMenuItem getUeberMenuItem() {
if (ueberMenuItem == null) {
ueberMenuItem = new JMenuItem();
ueberMenuItem.setText("Über...");
ueberMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//new JDialog(GuiVerwalten.this, "Über", true).show();
new JOptionPane.showMessageDialog(GuiVerwalten.this, "Eggs aren't
supposed to be green.").show();
}
});
}
return ueberMenuItem;
}
==
I would like to replace the JDialog, inserted by the VE, with a
JOptionPane, however, Java says: "JOptionPane.showMessageDialog cannot
be resolved to a type".
How can I solve this problem?
Thanks!
Arnaud Berger - 23 May 2005 09:14 GMT
> Hi,
Hi,
> I am using the Eclipse Visual Editor M1. I have the following JMenu:
>
[quoted text clipped - 9 lines]
> new JOptionPane.showMessageDialog(GuiVerwalten.this, "Eggs aren't
> supposed to be green.").show();
showMessageDialog is a static method in JOptionPane, so remove the "new"
keyword
> }
>
[quoted text clipped - 11 lines]
>
> Thanks!
Regards,
Arnaud
Roland - 23 May 2005 10:52 GMT
>>Hi,
>
[quoted text clipped - 16 lines]
> showMessageDialog is a static method in JOptionPane, so remove the "new"
> keyword
Further showMessageDialog(Component,Object) is a void method, so
invoking show() on it is meaningless.
>>}
>>
[quoted text clipped - 15 lines]
>
> Arnaud

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \