Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Eclipse VE, JOptionPane

Thread view: 
Stefan Lintner - 23 May 2005 09:09 GMT
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_/ /__/
/  \ /_/ /  \



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.