• 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

one click and the whole ROW will be selected

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


how can I do this? in just one click, one of my desired selected ROW will be selected?

i dont know how to implement this method >> getSelectedRows(), getSelectedColumn
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is regarding a JTable selection and you post code that deals with an ImageIcon, several menus and who knows what else. Definitely not the best way to get help on a public forum.

Recommended reading:
1. http://mindprod.com/jgloss/sscce.html
2. http://catb.org/~esr/faqs/smart-questions.html
 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right, if you click on the JTable, then the row you clicked on will be selected. But that wasn't your question, was it? You seem to be asking how to make your program do something when a row is selected. If that's your question, then the API documentation for JTable (follow this link) has a link to the JTable tutorial very near the beginning. Follow that and start reading the tutorial. There's a section about "User Selections" which will probably answer your question.
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I beg your pardon.. im sorry to make the title unclear or irrelevant to the posted code, .. what i want in my JTable is when i click a row, that row will be highlighted, but in this case i have an image Background in my Jtable,
Im having problems with that,

When I tried to remove the background , I can easily do that specific thing that I want, the whole row that I clicked was Highlighted, because of the background I cant see the highlight,
but I need to apply an Image Background in my JTable...

Is there anything to do with TableRenderer?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you've made each cell component transparent, so how do you expect it to show a highlight color?

perhaps changing your prepareRenderer code to set opacity in line with isRowSelected(row), might do what you want
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!