progress bar

hai have a peace day. i have a progress bar program. but i don't know how to implement in other program. please give any idea or sample codethank uregardsrex
[208 byte] By [rex1983a] at [2007-10-3 4:17:13]
# 1
> i have a progress bar program. ....> please give any idea I have no idea what your problem is> or sample codebetter for you to post your problematic code
Michael_Dunna at 2007-7-14 22:18:48 > top of Java-index,Desktop,Core GUI APIs...
# 2

this is the sample program

i want implement

eg. while copying thro program, the progree bar pgm was executed

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class Progress extends JFrame {

JProgressBar current;

JTextArea out;

JButton find;

Thread runner;

int num = 0;

public Progress() {

super("Progress");

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel pane = new JPanel();

pane.setLayout(new FlowLayout());

current = new JProgressBar(0, 2000);

current.setValue(0);

current.setStringPainted(true);

pane.add(current);

setContentPane(pane);

}

public void iterate() {

while (num < 2000) {

current.setValue(num);

try {

Thread.sleep(500);

} catch (InterruptedException e) { }

num += 95;

}

}

public static void main(String[] arguments) {

Progress frame = new Progress();

frame.pack();

frame.setVisible(true);

frame.iterate();

}

}

rex1983a at 2007-7-14 22:18:48 > top of Java-index,Desktop,Core GUI APIs...
# 3

perhaps you should start here

http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

to simplify the above code, I've previously posted the 3 files as one (reply #6)

http://forum.java.sun.com/thread.jspa?threadID=693345

so all you have to do is copy/paste/compile/run

it looks similar to what you may be trying to do (with textArea and button etc)

Michael_Dunna at 2007-7-14 22:18:48 > top of Java-index,Desktop,Core GUI APIs...