 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jason Cavett Guest
|
Posted: Wed May 16, 2007 11:01 pm Post subject: JProgressBar - Determinate Works, Indeterminate Does Not |
|
|
I am developing a table that has a JProgressBar in one of its cells.
Below is my code for the TableCellRenderer (which is a JProgressBar).
This currently works. For each process I add to the table, a progress
bar is updated to match the progress for that specifici process.
public class ProgressBarRenderer extends JProgressBar implements
TableCellRenderer {
private static final long serialVersionUID = 1L;
/**
* Default constructor
*/
public ProgressBarRenderer() {
this.setStringPainted(true);
this.setBorderPainted(false);
}
/**
* @see
javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
* java.lang.Object, boolean, boolean, int, int)
*/
public Component getTableCellRendererComponent(JTable table, Object
value,
boolean isSelected, boolean hasFocus, int row, int column) {
setValue((Integer) value);
return this;
}
}
Because different types of "processes" can be added to the table, I
want to make the JProgressBar indeterminate for certain processes and
determinate for others.
I am havnig two issues.
1. If I try to set the progressbar to indeterminate mode, it seems to
"catch" onto other JProgressBars that are running in the table and
starts updating with their values. (This happens sometimes.)
2. Otherwise, it goes into indeterminate mode but the bar doesn't move
back and forth during processing (processing takes place in a separate
thread).
If anybody here could help me out, I'd appreciate it. Thanks. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|