wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JFrame monitor of a calculation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame monitor of a calculation" Watch "JFrame monitor of a calculation" New topic
Author

JFrame monitor of a calculation

Arie Uittenbogaard
Greenhorn

Joined: Feb 23, 2004
Posts: 1
Who can tell me how the progress of a certain calculation can be shown in a JFrame?
I've made a JFrame, complete with a Panel & GridBag layout. Then the program begins a calculation (say, int x runs from 0 to 1,000,000 by means of a x++ loop).
On GridBag location [0,0] lives a JLabel that says "x = ".
Now I would like to see on location [0,1] my dapper int x grow ever larger until x = 1,000,000.
How should I go about that?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Swing doesn't do well with this; it would take a lot of work. If you have a long-running task and need to keep the user apprised of the progress you can use a JProgressBar.

Usually, updates come as a result of, or in response to user interaction. The app below shows this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFrame monitor of a calculation
 
Similar Threads
Automatically resizing JPanels when JFrame is resized by dragging.
Getting Relative Mouse Coordinates
does == count as arithmetic calculation?
Just confirm it...
data type of results of java arithmetic calculation