• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic