This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JXTable: Display the default selected row in the scroll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JXTable: Display the default selected row in the scroll " Watch "JXTable: Display the default selected row in the scroll " New topic
Author

JXTable: Display the default selected row in the scroll

Vo Hien
Greenhorn

Joined: Mar 27, 2007
Posts: 15

Hi Everyone,
I am working with JXTable and I add an dataModel to the table. The dataModel contains about 200 items. One of the item is selected as default (The checkbox in the row is selected) when the table is displayed.

When the selected row is about 180, the table will not display the selected row, because all the items in display inside a scrollpane, so when can see only the first item(ex: from 0 ->50).

How can we set the table so that when the table is displayed, it will show the selected row as default.

Thanks and regards,
Hien

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10274
    
    8

I haven't worked with JXTable myself, but if it extends JTable, check out JTable#getCellRect() and JTable#scrollRectToVisible()


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JXTable: Display the default selected row in the scroll