Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to know which table that is selected  RSS feed

 
Henrikk Andersson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have two JTables in a splitpane and below I have a row of buttons. My problem is: how do I know what table the user is working on? (ie when the user hits the delete button to delete a table row)? Can it be solved without using global variables?

It's the button that has focus. I have tried with transferFocusBackward() and transferFocusDownCycle() but it didn't work.
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm not sure, but i think anything to do with transfering focus will use the component tab-order, not a 'last-visited' cycle..

you could try using a Stack. you could push breadcrumbs onto the stack in your listener. when delete btn is selected, you could pop off the last breadcrumb, confirm row w user (being nice), then delete.


hth
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!