GeeCON Prague 2014*
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


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: 10426
    
    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!]
 
GeeCON Prague 2014
 
subject: JXTable: Display the default selected row in the scroll