Question

I would like to ask:

  1. Is it possible to have a JProgressBar that moves incessantly unless stopped explicitly? I know that the most common way to use a JProgressBar is to listen for changes and to change the progress by using the setValue(). If it is , how ?
  2. Can a JProgressBar be added to the cell of a JTable. If so, how ?
Was it helpful?

Solution

  1. Yes. I see two solutions here: use a Swing Timer that repeatedly changes the value of the progress bar or use the setIndeterminate(true) of the JProgressBar.
  2. Yes and no. Yes you can use it in a JTable (you need to change the TableCellRenderer). However, if you plan on using the "Indeterminate" progress bar, it won't work because of the JTable rendering mechanism which only "paints" the component but there are no "live" components inside the JTable.

Providing more context and what you are actually targetting would probably allow us to give you a more detailed and concise answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top