Re: Invsible Button!?
Bart Rider ha scritto:
public ProgressMonitor(String title) {
super(title);
panel = createPanel();
Your global var 'panel' is set by createPanel() and
then reassigned with the return value. Big flaw in
programming.
....you know, i'm a beginner, let me make these mistakes :P
i don't want my program is perfect, i want that my program works.
[cut]
Despite some flaws in your prog I changed nothing except:
adding this:
import java.awt.*;
import javax.swing.*;
adding this to the classes body:
public static void main( String []args ) {
new ProgressMonitor( "Hallo" );
}
and replacing the line
> BAR_MAX = AnalisiParagrafi.getNumberOfParags() - 1;
with
BAR_MAX = 200;
.
I didn't get the problem you discribed, the button you
missed was placed exactly beneath the progress bar. (after
resizing the window it moved to a position after the bar,
so you might consider the hint Matt gave.)
Maybe you should report back the exact circumstances under
which your prog runs.
as i've noticed if u invoke my class with a simple call procedure, it
works fine.
I'll try to explain how my program works (sorry for my poor english).
My program makes some operations on the paragraphs of a text.
When i push a button 'GO' in the main window of my program, the text's
processing starts and this Progress Monitor panel becomes visible.
I need, in this Progress Monitor panel, the progress bar updated for
each paragraph, (the 'i' index is the number of the current paragraph,
BAR_MAX is the edge of my progress bar) and the stop button visible to
stop the execution when i want.
I dont use threads (another big mistake...i know) and i've tried to
follow Matt's advice, but it doesn't work.
I wanna thank all of you for the precious help.
Sergio.