This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with JTable  RSS feed

 
Maged Roshdy
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not much into JTable yet.I am just trying to put JProgressBar on a custom column and i want to see a simple code that explain how to do that.
Please advice.
Thanks
Maged
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to write your own TableCellRenderer:
class ProgressCellRenderer extends JProgressBar implements TableCellRenderer
you have to set this renderer explicitely. See the swing tutorial on renderers for how to do this.
see the source of DefaultTableCellRenderer to find out what methods to overwrite for better performance!
chantal
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!