aspose file tools
The moose likes Swing / AWT / SWT / JFace and the fly likes JOption Pane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JOption Pane problem" Watch "JOption Pane problem" New topic
Author

JOption Pane problem

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 75
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
Posts: 75
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
Posts: 1811



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


Steve
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7059

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


[Donate a pint, save a life!] [How to ask questions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 25055
And I think this thread would sit better on the Swing forum. Moving.
Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 75
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
Posts: 3610
wrap what you want to persist in a do/while

simple demo

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 75
Thanks! Works like a charm.
 
 
subject: JOption Pane problem
 
developer file tools