Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JTable  RSS feed

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
On the last cell inside my JTable I have to Tab away from that cell in order for that cells data to be counted. Is there a way where I can get all the data from each cell without having to tab away from the last cell?
Also when I click into a cell first of all it always is the color yellow untill I start typing in that cell. I have had a look at all the diffrent color methods ie background, forground etc but still cannot find the right one. so could someone put me right on this please?
Thanks
Ben
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know how to answer the first part of your post.
It seems to me that in the second part, you are complaining about the color of the cell when it has the focus. Write a TableCellRenderer implementation that sets the the color of the cell when the argument hasFocus to the method TableCellrenderer.getTableCellRendererComponent(...) is true.
There are excellent examples of writing a TableCellRenderer around this forum at the moment. Or visit How to use Tables in the Java Tutorial.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!