I'll try...
the parameters of the method look like this:
public static void showMessageDialog(Component parentComponent,
Object message,
String title,
int messageType)
throws HeadlessException
Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used
message - the Object to display
title - the title string for the dialog
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
icon - an icon to display in the dialog that helps the user identify the kind of message that is being displayed
I quoted this from JavaDocs.. Like for example, from here:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html
And this is also what you would need:
http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/components/dialog.html
So, when You writted it, it was like:
JOptionPane.showMessageDialog(null, "Please enter File path", "Error", JOptionPane.WARNING_MESSAGE );
You can see, that you have written 'null' in the place of the 'parentComponent' (Component),
So, when Rob Prime have written:
from null to a real component
, he meant that
You should try to change from null to *
"the real" Component*...
I am not sure which is it, becaouse I am learning it now, but it could be a JFrame (a "parent Window"), or a JPanel, or something like this. You should read the "how to..", and javadoc...
But for now, simply replace 'null' with anything that you have in your program (the real component) like JFrame, panel, etc... i don't know, but it's in examples...
[EDIT:]
There are different types of dialogs... That is important. You can read about it in "How to use dialogs", link is above, and in the javadoc.
[EDIT2:]
Actually,...