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
3
votes
2 answers

Visible JProgressBar while initializing main GUI

I'm building a fairly complicated GUI for a project I'm working on. Importantly, it contains (among other things) a JTabbedPane with 12+ panes of complex GUI components. What I'm trying to do is display a JProgressBar when I'm instantiating these…
BenCole
  • 2,092
  • 3
  • 17
  • 26
3
votes
2 answers

JProgressBar with double value

Hello i would like to know if i can extends a JProgressBar to use double value for min max, instead of int. Thank you.
wotan2009
  • 151
  • 1
  • 3
  • 6
3
votes
3 answers

How to make Timer countdown along with progress bar?

How can I make it so that the progress bar slowly goes down with the time limit? class GamePanel extends JPanel implements MouseListener, ActionListener { private JButton quit; private JButton q; private Font loadFont; public…
wannabeprogrammer
  • 125
  • 1
  • 3
  • 9
3
votes
4 answers

Optional cannot be converted to Int (for use on GUI Progress Bar)

I am receiving below error, when I try to set value on a JProgressBar. "Optional cannot be converted to Int" Could someone please advise any workarounds/Solution?? public GUI(){ initComponents(); tL = new TasksToDo(); …
craig157
  • 355
  • 1
  • 3
  • 18
3
votes
1 answer

Reading a big text document and filling up a JProgressBar as it's being read

I'm trying to figure out how to make a JProgressBar fill up as a file is being read. More specifically I need to read in 2 files and fill 2 JProgressBars, and then stop after one of the files has been read. I am having trouble understanding how to…
3
votes
4 answers

Update progressbar from worker thread

I'm building a java program that downloads N elements from a server. I'd like to have a working progress bar, that shows "already downloaded elements"/N percentage. Right now, I update progressbar value by passing to the thread a reference to the…
kaharas
  • 597
  • 2
  • 17
  • 39
3
votes
4 answers

How do I use JProgressBar to display file copy progress?

I am working on a project that transfers files over a network and I want to incorporate a JProgressBar to show the progress during file transfer but I need help on that.
master-mind
3
votes
2 answers

How JProgressbar should work?

In the example code below I use to calculate a files hash. Therefor I start a Jprogressbar to show the progress. However sometimes it stops at 99% and sometimes it doesn't run. I read already different tutorials and code examples. It is maybe a…
loadP
  • 404
  • 1
  • 4
  • 15
3
votes
3 answers

Java GUI JProgressBar not painting

I have a GUI problem that I would like to get sorted out, but I am baffled as to what's happening and hope one of you can explain it. The code base is way too large to upload however I will explain in detail what's happening: I have a class…
Ryan
  • 3,579
  • 9
  • 47
  • 59
3
votes
3 answers

JProgressBar does not update within the loop

I am currently self-studying Java. I've been trying different things like JRadioButtons, JcomboBoxes etc. Now, I'm trying to use JProgressBars but it doesn't seem to work properly. Relevant piece of code: JProgressBar progress; JButton button; …
Spikatrix
  • 20,225
  • 7
  • 37
  • 83
3
votes
3 answers

Open new JFrame when progress bar reaches 0?

Im trying to make a java game where when the players health reaches 0 the game should end but currently when my progress bar reaches 0 nothing happens here is my code is there something wrong with it? JProgressBar healthProgressBar = new…
3
votes
1 answer

How to customize a JProgressBar?

I am making a launcher and I want to have a customized ProgressBar. I have done some research and it's possible with JavaFX(Never did something with it) and it's possible with replacing the UI. I am looking for a bar with rounded edges and a rounded…
RuuddR
  • 941
  • 4
  • 13
  • 25
3
votes
2 answers

Set JProgressBar TEXT color

I have a JProgressBar called playerhealth. I the the color of the bar to green. This makes the text hard to see, so I want to set the color of the text inside the JProgressBar to be black. I read that you can use UIManager to set the global color…
3
votes
1 answer

Progress copying contents of an array to JTextArea using JProgressBar

I want to use JProgressBar to monitor the progress of copying the contents of a byte array to a JTextArea. In fact, I've read to many tutorials about that but I am still getting a stuck in the following piece of code: byte[] encodedImg =…
Michael
  • 179
  • 11
3
votes
1 answer

Java Swingworker: Not as encapsulated class

I'm having problems passing information, updating progress and indicating "done" with a SwingWorker class that is not an encapsulated class. I have a simple class that processes files and directories on a hard drive. The user clicks on the Start…
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154