Why can't I get the MessageDialog to show?

I don't think I'm doing anything wrong!!

Page 1 of 1

2 Replies - 334 Views - Last Post: 23 October 2010 - 05:12 AM Rate Topic: -----

#1 taylor.alison  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 14-October 10

Why can't I get the MessageDialog to show?

Posted 23 October 2010 - 04:25 AM

I cannot display a Dialog!! I have been trying everything I can, I have imported javax.swing.* at the top and I am trying to use either this
JOptionPane.showMessageDialog(frame,"You finished the game!", "Winner!");

or this
JOptionPane.showMessageDialog(null, "You finished the game!", "Winner!");

This is being called somewhere in the ActionPerformed method. I am getting this error:

cannot find symbol method showMessageDialog(javax.swing.JFrame,java.lang.String,java.lang.String)

Can anybody see what I'm doing wrong here?

Is This A Good Question/Topic? 0
  • +

Replies To: Why can't I get the MessageDialog to show?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: Why can't I get the MessageDialog to show?

Posted 23 October 2010 - 04:56 AM

There appears to be no showMessageDialog() method which takes three arguments. You probably want this one, which has 4.
Was This Post Helpful? 1
  • +
  • -

#3 taylor.alison  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 14-October 10

Re: Why can't I get the MessageDialog to show?

Posted 23 October 2010 - 05:12 AM

Ah thanks so much, silly mistake ^^

I thought that if you left one of the parameters blank it would use the default option.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1