AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JProgressBar - Determinate Works, Indeterminate Does Not

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Jason Cavett
Guest





PostPosted: Wed May 16, 2007 11:01 pm    Post subject: JProgressBar - Determinate Works, Indeterminate Does Not Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.