Questions tagged [jprogressbar]

JProgressBar is a Java Swing component that visually displays the progress of some task.

JProgressBar is a Java Swing component that visually displays the progress of some task. As the task progresses towards completion, the progress bar displays the task's percentage of completion. This percentage is typically represented visually by a rectangle which starts out empty and gradually becomes filled in as the task progresses. In addition, the progress bar can display a textual representation of this percentage.

For details and examples see How to Use Progress Bars tutorial.

492 questions
4
votes
2 answers

Download a file while also updating a JProgressBar

I have tried tones of different methods to get this to work but they either don't work with a progress bar or don't work the way I would like it to. I have already created a new window with a progress bar and need to create a method which would…
Keir Nellyer
  • 913
  • 5
  • 12
  • 20
4
votes
3 answers

Need to have JProgress bar to measure progress when copying directories and files

I have the below code to copy directories and files but not sure where to measure the progress. Can someone help as to where can I measure how much has been copied and show it in the JProgress bar public static void copy(File src, File dest) throws…
user1815823
  • 617
  • 2
  • 8
  • 14
4
votes
4 answers

JProgressbar: how to change colour based on progress?

Is it possible to be able to change the bar colour depending on the value of the progress? I tried the following but it doesn't work: percentUsed = (int)(((float) used / (float) max) * BAR_PERCENTAGE); if (percentUsed >= ORANGE_THRESHOLD && …
Foo
  • 293
  • 1
  • 3
  • 14
4
votes
1 answer

Getting my jProgressBar to run on a timer from 1 to 100

I was looking through this thread How to make Timer countdown along with progress bar? I would like to add this to my code so i can just get a jProgressBar and a Button, (Using netbeans preferably) So that when I hit the button it runs from 0 to…
Jack
  • 2,891
  • 11
  • 48
  • 65
4
votes
2 answers

Nimbus L&F - Change Background color of Progress Bar

i'm developing a little GUI application with Java using Netbeans Editor. I've put in a JFrame a simple Progress Bar. I'm developing the project with JDK7 I want to change the background Color from default Orange to a personal one. I've already tried…
Deviling Master
  • 3,033
  • 5
  • 34
  • 59
4
votes
1 answer

Custom Painter on JProgressBar

I'm attempting to change the colour of Progress Bars in my current Swing L&F (I'm using Nimbus at the moment) by using a custom Painter object, but when created these Progress Bars sometimes stick with their original colouring (this change seems to…
mdhillman
  • 91
  • 1
  • 6
4
votes
1 answer

How to change the color of a single JProgressBar in Nimbus?

I'm trying to change the color of a single JProgressBar in Nimbus LAF (Look And Feel). This solution does work, but it changes the colors of ALL JProgressBars :/ UIDefaults defaults = UIManager.getLookAndFeelDefaults(); …
user1430180
  • 43
  • 1
  • 3
4
votes
3 answers

JTabbedPane: show task progress in a tab

I have a simple Swing Java application that performs searches, and the results are shown in a new tab. While the search is running, I want to show a progress icon or animation in the title of the tab. I tried adding a gif icon, but it doesn't…
Paco
  • 468
  • 5
  • 10
3
votes
2 answers

JProgressBar doesn't update , can't find a clue

nice job , now i just wanna know why if i add into while loop the instruction System.out.println below the progress is shown on both , cmd and Pgbar in the Gui ?? : while(progress < 99){ System.out.println("into while of PBar Thread progress =…
The Eighth Ero
  • 417
  • 4
  • 13
3
votes
3 answers

JProgressBar setValue is not working, tried with SwingUtilities as well

I have implemented a JProgressBar in a JTable. I used renderer for the ProgressBar NOT EDITOR. Now I tried to implement a ProgressBar set value but due to EDT its not working so I used SwingUtilties but it did not work as well. EXPECTED BEHAVIOUR -…
Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128
3
votes
2 answers

JProgressBar from InputStream

There are many posts on JProgressBar, but I can not find a solution for the following problem. How do I update JProgressBar measuring bytes received from InputStream? For example, I have the following code: int bytesRead; byte buffer = new…
jadrijan
  • 1,438
  • 4
  • 31
  • 48
3
votes
2 answers

Running a JFrame with a JProgressBar

public void myMethod { MyProgessBarFrame progFrame = new MyProgressBarFrame(); // this is a JFrame progFrame.setVisible(true); // show my JFrame loading // do some processing here while the progress bar is running // ..... …
epsac
  • 198
  • 5
  • 17
3
votes
1 answer

Simulating a long-running operation

How could I simulate a long-running database operation? My requirement is to display a dialog box with a JProgressBar until the operation is completed.
James P.
  • 19,313
  • 27
  • 97
  • 155
3
votes
1 answer

How to use JProgressBar

I want to use JProgressBar and it must be loaded in one second. I don't want wait for any task to complete. Just want to fill the progress bar in one second. So I write following code. But it doesn't working. progress bar wasn't filling. I am new to…
Jayanga Kaushalya
  • 2,674
  • 5
  • 38
  • 58
3
votes
2 answers

Update JProgressBar Without Knowing Progress

I want to use a JProgressBar but I don't have any measurement of progress for how long the task will take to complete. The idea is to have a progress bar displaying the status of a shutdown process but I don't know how long it takes, and I have no…
Hank
  • 3,367
  • 10
  • 48
  • 86
1 2
3
32 33