Results 1 to 3 of 3
Thread: problem with repaint bar
- 07-12-2011, 01:53 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 10
- Rep Power
- 0
problem with repaint bar
Hello all!
I have a problem with repaint bar process.
when the apps start I hide it with visible=false
but when I click on button I what to see it agian but still cant.
here is the code:
this block works:
public start() {
initComponents();
jProgressBar1.setVisible(false);
}
but here is my problem:
private void searchButActionPerformed(java.awt.event.ActionEven t evt) {
jProgressBar1.setVisible(true);
start.jProgressBar1.repaint();
just cant do a repiant or flash to the form.
my GUI looks like that:
ImageShack® - Online Photo and Video Hosting
thanks for helping me.
- 07-12-2011, 02:00 PM #2
Oh mai god. So much white space. Could you use [code][/code] tags when posting your code? It will help us look at your code.
What is the purpose of this code
Also, posting in an Short, Self Contained, Correct Example will also help us to help you.Java Code:private void searchButActionPerformed(java.awt.event.ActionEven t evt) {- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
- 07-12-2011, 02:37 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 10
- Rep Power
- 0
this is a buttion that supposed to do search on the net(when this buttion clicked the application started to work).I just want to see the bar.
the implimintation of the bar is a thread
when the app is comlete then done=true.Java Code:ublic class threadProcessBar implements Runnable { public Boolean done; public long interval=1000; public void run() { System.out.print("thread Process Bar started "); done=false; start.jProgressBar1.setVisible(true); start.jProgressBar1.setIndeterminate(true); start.jProgressBar1.setString("Loading"); start.jProgressBar1.repaint(); while(!done) { try { Thread.sleep(interval) ; } catch (InterruptedException ex) { } } start.jProgressBar1.setValue(100); start.jProgressBar1.setIndeterminate(false); start.jProgressBar1.setString("Done"); start.jProgressBar1.repaint(); } }
I can see the bar only when message pop up from searchButActionPerformed then it appeared.
I tested it and only if I do JOptionPane.showMessageDialog(null, "start");
and then start.jProgressBar1.setVisible(true); its work but without the message it dosent work. Why is that?Last edited by vitaly87; 07-12-2011 at 03:16 PM.
Similar Threads
-
problem with repaint()
By ankit1801 in forum New To JavaReplies: 2Last Post: 03-29-2011, 09:26 AM -
repaint() problem ?
By santa in forum New To JavaReplies: 4Last Post: 02-09-2011, 11:47 AM -
repaint problem
By amith in forum Java 2DReplies: 2Last Post: 07-01-2008, 12:10 AM -
Problem in repaint
By Preethi in forum AWT / SwingReplies: 16Last Post: 03-18-2008, 08:10 PM -
Repaint problem
By swimberl in forum Java 2DReplies: 0Last Post: 01-06-2008, 03:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks