File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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:
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:
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 1900



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


Steve
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7602

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: 26710
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: 4041
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
 
Threads others viewed
help with number formats
How to suppress leading zero in decimalformat
Float / Double format
Back to basics: if statement
rounding float to float
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com