-
August 6th, 2012, 04:12 AM
#1
How to get Focus to the cell in JTable, when its cells are rendered and edited?
The table i am using has combobox, Datepicker, RadioButtons, etc in the cells. When i am navigating inside table, i wont be able to know, in which cell i am. Focus is not visible. Tried,
table.setCellSelectionEnabled(true);
table.changeSelection(0, 1, false, false);
table.setColumnSelectionInterval(0, 0);
table.setRowSelectionInterval(0, 0);
table.requestFocus();
But nothing is getting focus in cell. Please help me out.
-
August 6th, 2012, 04:41 PM
#2
Re: How to get Focus to the cell in JTable, when its cells are rendered and edited?
The way I've done it in the past is:
Code:
table.changeSelection(row, column, false, false);
table.requestFocus();
Remembering to configure cell selection when you create the table using:
Code:
table.setCellSelectionEnabled(true);
If this doesn't work you'll need to show more code so I can see what you are doing.
-
August 7th, 2012, 02:13 AM
#3
Re: How to get Focus to the cell in JTable, when its cells are rendered and edited?
Hello keang, thanks for ur reply. I tried the same thing which u hav mentioned, and also those things whic i specified in my 1st thread. Seems nothing working. No more extra code in my code Don't kno wat else sud i do.
-
August 7th, 2012, 02:30 AM
#4
Re: How to get Focus to the cell in JTable, when its cells are rendered and edited?
Can you post a runnable code example that demonstrates the problem you are having.
What version of Java are you using?
-
August 7th, 2012, 02:44 AM
#5
Re: How to get Focus to the cell in JTable, when its cells are rendered and edited?
I am using JDK1.6 , Code is integrated and linked wit other code, which is confidential to project. Sorry..
-
August 7th, 2012, 01:20 PM
#6
Re: How to get Focus to the cell in JTable, when its cells are rendered and edited?
I didn't ask for your project code, I asked you to post some example code that demonstrates the problem ie a simple class that display a JTable and instructions on how to use it to show the issue you are having.
If you can't post any code to show how you are configuring and using the JTable then it's going to be hard to help you further.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|