Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

JButton inside JTable Cell

800429Nov 8 2005 — edited Jan 5 2009
Hi guys, I really need some help......

I am working with JTable, and would like to show a JButton inside the last table column... This button will perform some actions when the user click on it.

But I don't know how to solve some problems. I already create the table model, renderer, cell editor, my fired event are almos right, but I really think that are a lot to do until finish it.

Right now, I am with the followign problems:
1) How can I do to the button (inside the table) fire an event every time the user click on it, instead to force the user to click on button and press the enter?!!?!?

2) I would like to made the button disappear after the user click on it (or force it do setEnabled(false) to prevent user repeat the same action. To solve it I set the CellEditor component to not visible when the stoppingEdit is finished, but whem the user click on another table row my old button becomes visible automaticaly. How can I fix this things?!!??

ps: I know that it is a very complicated thing, and propably will need a lot of source code, so if anyone knows a good tutorial it will be welcome too.

Thanks all
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2009
Added on Nov 8 2005
15 comments
15,380 views