The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Swing / AWT / SWT / JFace
 
RSS feed
 
New topic
Author

JOption Pane problem

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Messages: 57

Hello All, I am trying to get the following code to compile and run, I am getting an error message:

Here is the code:

This message was edited 3 times. Last update was at by Dan Grindstaff

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Messages: 57

OK, I figured out what was causing the problem, but now I would like to make a third JOptionpane that asks "would you like to try again?". The program should not end until the user selects 'no'.

Here is the cleaned up code:

This message was edited 1 time. Last update was at by Dan Grindstaff

Steve Luke
Bartender

Joined: Jan 28, 2003
Messages: 1401



What does df.format(...) do? You should read the method's API: Format#format(...)

Steve
Maneesh Godbole
Bartender

Joined: Jul 26, 2007
Messages: 4236

Dan,
In future, while posting code please do use code tags

work is the scourge of the drinking class
Campbell Ritchie
Bartender

Joined: Oct 13, 2005
Messages: 14952

And I think this thread would sit better on the Swing forum. Moving.
Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Messages: 57

Thanks, all for your help. I am still wondering how to get a JOptionpane to persist. I want there to be a 'master' JOptionpane that asks something like 'would you like to try again?' and if no exit program. TIA.
Michael Dunn
Rancher

Joined: Jun 09, 2003
Messages: 3090

wrap what you want to persist in a do/while

simple demo

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Messages: 57

Thanks! Works like a charm.
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Swing / AWT / SWT / JFace
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench

.