i have a problem with code below

import javax.swing.*;
class HelloWorld

    public static void main(String x[])



i try my best but i can not understand the following error

HelloWorld.java:5: error: cannot find symbol
  symbol:   method showMessageDiloge(<null>,String,String,int)
  location: class JOptionPane
1 error

plz help me

2 Years
Discussion Span
Last Post by mKorbel

The symbol it can't find is "showMessageDiloge" (see line 4 of the error!)
It's because you spelled it wrong.
See the API doc for JOptionPane for the correct spelling


Slavi: that's the Java 7 version, probably OK, but we should be referring people to the current version of Java (Java 8) unless there's a specific reason not to.

Here is the current API documentation.
It contains details of all the methods and variables for all the classes in the Java SE API. It's an absolutely essential tool for anyone writing Java. I know it's inimidating at first, you absolutely MUST get familiar with it.
I keep it permanantly open in a tab in my browser. and so should you.


agree with Java8 docs for Swing APIs, there weren't significant changes (excluding bridges/APIs between JavaFX8 and Swing)


There were all kinds of tiny improvements in Java 8 that weren'y big enough to make the press release, for example (one of my favourites)...
how many times have you done this:

Object value = myMap.get(key);
if (value == null) {
   value = some default or new value

Java 8 added

Object value = myMap.getOrDefault(key, defaultValue);

OK, it's not earth-shattering, but these things add up to smaller clearer code, and we need all the help we can get with that!


@JamesCherrill OT - (Xxx)Map isn't good underlaying array for Swing, missing internal index, must be indexed as key, e.g. you can lost indexing in JTable (view v.s. model and vice versa)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.