Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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: 48921
58
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic