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
2
votes
1 answer

JProgressBar doesn't update in real time within a loop

It is the first time I have to work with a progress bar and I'm facing a problem, besides I try to call its setValue(x) from everywhere it keeps on 0% and goes straight to 100% after my method routine finishes. I tried to make an inner class that…
2
votes
1 answer

How to Use JProgressBar on Button Click

In gui there are two fields which add two numbers on button click and there is code logic to check if the fields are empty but what i want is when user click on the button it should display a progress bar according to milliseconds progress should go…
user5260030
2
votes
6 answers

Update JProgressBar

I can't update my progressbar... this is my code Thread t=new Thread(new Runnable(){ public void run(){ int i=1; jProgBar.setMinimum(0); jProgBar.setMaximum(100); try { …
raf
  • 1,121
  • 3
  • 13
  • 14
2
votes
1 answer

How to make the JDialog invisible when the JProgressBar reaches 100%?

Relevant piece of code: JProgressBar progress; JButton button; JDialog dialog; //Fields of my GUI class progress=new JProgressBar(JProgressBar.HORIZONTAL,0,100); button=new JButton("Done"); dialog=new JDialog(); //Done from…
Spikatrix
  • 20,225
  • 7
  • 37
  • 83
2
votes
1 answer

How to use progress bar with Zip writer?

I have made a program which let's the user to select a file and then ask the user to make a new zip file. The program then writes the selected file in the zip file. But I don't know how to set a JProgressBar to tell the user the progress. But I…
2
votes
3 answers

Update JProgressBar from new Thread

How can I update the JProgressBar.setValue(int) from another thread? My secondary goal is do it in the least amount of classes possible. Here is the code I have right now: // Part of the main class.... pp.addActionListener( new…
Dacto
  • 2,901
  • 9
  • 45
  • 54
2
votes
1 answer

Accurately summing file sizes to use in a JProgressBar

I have a list of files that I'm going to copy over to another location and I want to use a JProgressBar to monitor the progress of the transfer. The JProgressBar constructor only takes an int for the bounds and File.length returns a long. I know I…
nullByteMe
  • 6,141
  • 13
  • 62
  • 99
2
votes
1 answer

Can't get JProgressBar to update from SwingWorker class

I have my main GUI thread which has a JprogressBar in it and is implementing ProprtyChangeListener. When a button is pressed, a different class, which extends SwingWorker, kicks into action and performs a series of potentially long calculations. I…
Eitan Vesely
  • 125
  • 3
  • 16
2
votes
2 answers

JProgressBar text overflow

My program writes text in a JProgressBar. The problem is the text is wider than the JProgressBar's width. I have already changed the JProgressBar's height to be able to write the text on two lines but I don't want to the change the width. How to…
Maxbester
  • 2,435
  • 7
  • 42
  • 70
2
votes
1 answer

JDialog decorated true but without close button

Okay, researching I saw a lot of posts regarding to the topic "hide close button from dialogs" but none of them solved my problem.The thing is I have this Dialog: which I would like to keep the decoration (borders, transparency and etc) but I would…
Victor Oliveira
  • 3,293
  • 7
  • 47
  • 77
2
votes
2 answers

JProgressBar doesn't update during download

Using a swing button, I'm trying to download an html file and write it to a new html file, while doing a progress bar. When I click the button, my program seems to freeze until the download finishes, and then the progress bar is suddenly 100%. I'm…
Grux
  • 584
  • 1
  • 11
  • 20
2
votes
4 answers

JProgressBar will not update until process is completed

Tons of JProgressBar questions on here I know, but through all the answers and I can't seem to diagnose my issue. I am processing a file with some address verification software. I click the Process button and I need my JProgressBar to update with…
2
votes
1 answer

Change shape of JProgressBar

I am new to Java but needs to know that if it is possible for a developer so that he/she can change the shape of the JProgressBar. I mean suppose in my case I want to change the shape so that it looks like a circle or something else? Though I just…
Tech Nerd
  • 822
  • 1
  • 13
  • 39
2
votes
2 answers

Why "javax.swing.JProgressBar" displays new values on top of old values when I update from another class?

Problem: ClassA static JProgressBar progressBar; ClassB ClassA.progressBar.setValue(0); ... ClassA.progressBar.setValue(10); ... ClassA.progressBar.setValue(20); Progress bar displays 0, then 10 on top of the 0, then 20 on…
Arthur
  • 223
  • 2
  • 16
2
votes
1 answer

Color in JProgressBar

I just wanted to use the Windows L&F in a JFrame. Now while using a progress bar, the default color is green, similar to the one used in other windows functions like copying of files, etc. Sometimes you might have seen, windows displays a 'RED' -…
se7en
  • 87
  • 1
  • 3
  • 16