Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set foucs to a cell of JTable

 
Roshani Agrawal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JTextField as Component of table cell editor for the table.I want to set foucs to cell if the value of cell is > 1 .User is not allowed to do other functionality until he enters right value and till then foucs should be on that cell only.
Please let me know if anyone has solution for it.
 
Campbell Ritchie
Sheriff
Posts: 48394
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I don't think you can set the focus on anything, but most Swing classes have a method allowing them to request the focus. Have a look in the API.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic