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

When am I supposed to use javax.swing.SwingUtilities.invokeLater()?

I have a GUI which uses a JProgressBar. The GUI has JBUTTONs that invoke following code: public void updateProgressBar(int x) { System.out.println(javax.swing.SwingUtilities.isEventDispatchThread()); healthBar.setValue(x); } but I have also…
user2651804
  • 1,464
  • 4
  • 22
  • 45
3
votes
1 answer

Set a JProgressBar width to a fixed size

I've a JProgressBar on my JToolBar. The problem is that the JProgressBar is taking all the remaining space on the JToolBar instead of having a fixed width. I've tried using: Dimension prefSize = goButton.getPreferredSize(); prefSize.width =…
dazito
  • 7,740
  • 15
  • 75
  • 117
3
votes
1 answer

JProgressBar Gets Squeezed/ Resizes Improperly

I'm using a JProgressBar on my Swing gui: When I minimize the window while it's updating with progressBar.setValue() it will squeeze like this: Note that resizing or similar doesn't fix it. Why does it happen and how to prevent it? What causes it?…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
3
votes
2 answers

How to use Netbeans' indeterminate progress-bar style?

I'm programming a Java app using Nimbus look & feel. Unfortunately, the appearance of indeterminate JProgressBars of Nimbus look & feel is AWFUL (see below) : On the other hand, I've noticed Netbeans with Nimbus look & feel has a different…
Seyed Mohammad
  • 798
  • 10
  • 29
3
votes
2 answers

JProgressBar not updating from SwingWorker, while debugs work fine

This has been driving me up the wall for 2 days now. I can't seem to make the JProgressBar update properly and I'm not sure why. I've read through the concurrency and SwingWorker tutorials, I've tested outside of my program and been able to get it…
Jason Langois
  • 41
  • 1
  • 8
3
votes
1 answer

How to use Java progress bar while read a text file?

I am new to java swing, I want to read the text file. while reading that file i want to display the percentage of readed lines in java progress bar. Any sample code is welcome. i tried but i don't know whether my logic is correct or not. How can i…
PS Kumar
  • 2,096
  • 6
  • 30
  • 45
3
votes
1 answer

How to make a JProgress bar with a gradient

I am using swing and wanting to make my JProgress bar look more attractive by adding a soft gradient to it that matches the theme of the app. My progress bar is in a JTable cell which i have working but my current example paints the cell with a…
Riaan Schutte
  • 535
  • 1
  • 5
  • 14
3
votes
2 answers

Jprogressbar not working

I am trying to upload a few files over the network. while uploading it will take an indeterminate time. so wish to display an indeterminate jprogressbar during the upload. The problem, however is that my jprogressbar and upload does not work…
antony.ouseph.k
  • 907
  • 2
  • 15
  • 28
3
votes
1 answer

Progress bar for JGraphX layout

Is it possible to use a progress bar with an mxIGraphLayout? I have a graph that takes a non-trivial time to layout, and I would like the user to be able to see that, yes, something is happening. Ideally, I would like something that I can…
Troy Daniels
  • 3,270
  • 2
  • 25
  • 57
3
votes
3 answers

JProgressBar not updating

I have made a very simple code to show it here, i have a button that should show a JDialog to check the progress status, i am using the invoke late to go through EDT and my loop isn't in the run method, so why isn't my bar updating ? here is the…
user2548720
  • 109
  • 2
  • 2
  • 7
3
votes
3 answers

Is it possible to save text horizontal in vertical JProgressbar

JProgressBar in JProgressBar.VERTICAL mode rotates painted String. Is it possible to save string HORIZONTAL?
greensher
  • 285
  • 5
  • 20
3
votes
3 answers

JProgressBar Capable of hiding the 'bar' and not the 'fluid'

I understand that 'fluid' isn't the best description, but that's how I imagine the green that lays inside a progress bar. I was just wondering if it was possible to just see the green 'fluid' from the progress bar, and not the container that hold…
user2388169
  • 237
  • 1
  • 3
  • 9
3
votes
4 answers

Progress Bar Java

I am using JProgressBar to show progress. But, How to show the progressBar as loading from 0 to 100? I got the code from internet and its working except the progressBar is not loading. code progressFrame = new JFrame(); // frame to display progress…
vijay
  • 1,129
  • 7
  • 22
  • 34
3
votes
1 answer

Java JProgressBar using Image

I am making a game in Java, and I am using a JProgressBar for a health bar. I want to use an image (instead of colours) for the JProgressBar, but I have not been able to do it. I have tried using the paint method, paintComponent method, making a…
user1976336
  • 197
  • 4
  • 19
3
votes
2 answers

Vertical progress bar has strange background which is not changeable

The progress bar is created by the following code bar = new JProgressBar(JProgressBar.VERTICAL); bar.setEnabled(true); bar.setBackground(Color.YELLOW); bar.setForeground(Color.GREEN); bar.setStringPainted(true); …
Florian
  • 388
  • 2
  • 3
  • 13