aspose file tools*
The moose likes Java in General and the fly likes The method showMessageDialog(Component, Object) in the type JOptionPane is not applic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "The method showMessageDialog(Component, Object) in the type JOptionPane is not applic" Watch "The method showMessageDialog(Component, Object) in the type JOptionPane is not applic" New topic
Author

The method showMessageDialog(Component, Object) in the type JOptionPane is not applic

FairGhost
Greenhorn

Joined: Mar 19, 2005
Posts: 1
This is the code n its giving me the following error and even in bok code is correct same i haev have here, if some one can help
Thanx
import javax.swing.JOptionPane;
public class Compersion
{
public static void main (String args[])
{
int num1,num2;
String firstnum, secondnum, result;

firstnum = JOptionPane.showInputDialog("Enter First Number");
secondnum = JOptionPane.showInputDialog("Enter Second Number");

num1 = Integer.parseInt( firstnum);
num2 = Integer.parseInt( secondnum);

result = "";

if (num1 == num2)
result = result + num1 + "==" +num2;

if (num1 != num2)
result = result + num1 + "!=" +num2;

JOptionPane.showMessageDialog(null, result, "Compersion Results");
System.exit( 0);


Fortune favors the brave - Virgil
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Looking in the JOptionPane api for the showMessageDialog methods I see three listed in the Method Summary section. None of them take three arguments.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
What error do you get? Please copy-and-paste it here so we can explain what it means.

Layne


Java API Documentation
The Java Tutorial
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Mr. Ghost,

Welcome to JavaRanch!

You apparently missed reading our naming policy on your way in. It requires that your display name be a full, real, first and last name. Joke names and "handles" aren't acceptable here. You can change your display name here. Thanks.


[Jess in Action][AskingGoodQuestions]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Layne Lund:
What error do you get? Please copy-and-paste it here so we can explain what it means.

Layne


Hmm...I see that you tried to put the error message in the subject. However, it was truncated so we cannot see it all. Craig posted a basic explanation of what is wrong, but if you still need help, please post the full error message again. We'll be glad to help you from there.

Layne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The method showMessageDialog(Component, Object) in the type JOptionPane is not applic
 
Similar Threads
Large Numbers
Substitute for Cin in Java??
Problem with JCreator LE
HELP!!!! how does Character.isLetter work? (need experts)
Can't understand complier error