Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

JTable questions

Thread view: 
news.otenet.gr - 10 Jul 2007 23:23 GMT
I have a table with 5 columns.
1. How can I move the focus to cell in 5th col, 1st row?
2. How can I disallow the move of focus to a column different than 5th?
Roedy Green - 12 Jul 2007 03:46 GMT
On Wed, 11 Jul 2007 01:23:02 +0300, "news.otenet.gr"
<cham_gss@hotmail.com> wrote, quoted or indirectly quoted someone who
said :

>1. How can I move the focus to cell in 5th col, 1st row?

This is complicated slightly by the fact there are NO components
hiding behind each cell.  You use the same component to paint all the
bits for all the cells in a column.

Lets presume you can deal with scrolling so that you can figure out
the row/col you want either in the model or relative to the top of
window currently scrolled on screen.

I don't see any methods for setting focus, but there is the
SelectionModel.  Perhaps if you select the row, it will get focus.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Roedy Green - 12 Jul 2007 08:35 GMT
On Wed, 11 Jul 2007 01:23:02 +0300, "news.otenet.gr"
<cham_gss@hotmail.com> wrote, quoted or indirectly quoted someone who
said :

>1. How can I move the focus to cell in 5th col, 1st row?

I have been thinking about your problem.

Here are some ways you might tackle it.

1. look at all the code in the JTable components and see how focus is
handled.

2. Monitor the events that appear at JTable  when you give focus to a
cell.

3. create a synthetic event to give focus to the cell in question.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.