I have tried entering the following but I get an error:
The specific error is:
C:\Users\Dad\Documents\NetBeansProjects\CS8625\ParallelSpeedUpTutorial\src\com\yahoo\jeffciaParallelSpeedup\ParallelSpeedupGUI.java:631: cannot find symbol
symbol : variable frame
location: class com.yahoo.jeffciaParallelSpeedup.ParallelSpeedupGUI
JOptionPane.showMessageDialog(frame,"Eggs are not supposed to be green.","A plain message", JOptionPane.PLAIN_MESSAGE);
Note: C:\Users\Dad\Documents\NetBeansProjects\CS8625\ParallelSpeedUpTutorial\src\com\yahoo\jeffciaParallelSpeedup\ParallelSpeedupGUI.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
BUILD FAILED (total time: 0 seconds)
I think the problem is the first parameter. Can somebody please help me understand what the first parameter is?
Jeff Ciaccio, Java novice <br />Physics and AP Physics Teacher<br />Sprayberry High School <br />Marietta, GA
Hello Jeff, what is the first parm for the JOptionPane.showMessageDialog()? According to the API it's a "component". Now you put in "frame" and this variable not found. Then does your code have such variable? If no, you can put in null and it will compile.
That first parameter is the Component over which the dialog window is to appear. If you write null the dialog window will appear in the centre of the screen. Beware: it may hide "behind" other windows.
Joined: Nov 26, 2008
Thanks. It turned out to be a problem just before this line of code, but all is well now.