Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

excel but in a jTable  RSS feed

 
Niels Tielenburg
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write something in java so that you can use the jTable like excel. So I want to change the colour of cells and do some calculation.
And if somebody else wants to use it I like to have some methods like
anyone have any ideas?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use a meaningful subject line
You can change it by clicking on the

Recommended reading http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
Notice the Renderer section. That will help you play around with colors
 
P Goel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one way to achieve it is by using your own cellRenderer, you can extend DefaultTableCellRenderer and override the getTableCellRendererComponent() method. In this method you can customize cells of the table.
CellRenderer can be set for each column seperately.
Hope it will help you...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!