Link to home
Start Free TrialLog in
Avatar of paredes_mynor
paredes_mynor

asked on

View the current row in a JdbTable

For example, if I have a 10 row jdbtable height view, and I'm in the row 20.
How do I do to programmaticaly send the view to the row 1? I mean, put the row 1 as the current in the jdbtable and show it like it.

Thanks.
Avatar of SuperKarateMonkey
SuperKarateMonkey

How can you have a 10 row table and be at row 20?
Avatar of paredes_mynor

ASKER

Maybe I didn't explain it well.  I have a Table scroll pane, with a 10 row height view, and a jdbtable with "n" number of rows.  I'm scrolled down in row 20, and I want to set row no. 1 to be the current.

Thanks.
You'll need to figure out the height of your rows, the use the setScrollPosition() in the ScrollPane.
I'm sorry, I didn't undestand your answer.  Another thing, there's no setScrollPosition() method in either JdbTable or TableScrollPane classes.
Thanks.
Ah.  TableScrollPane.  Hmm.  I thought you meant a JScrollPane containing your Table.  Sorry.

Is there no equivalent in your TableScrollPane (eg. setVisibleRow() or scrollToRow() or anything like that)?

I've never used the class, so it's just a thought.
No, there's none similar to those.  I'll continue looking.  If you find something, I'll appreciate that a lot.
Thks.
According to this page:

http://pipin.tmd.ns.ac.yu/extra/java2/libs/dbswing/ref/dbswing/com.borland.dbswing.TableScrollPane.html

TableScrollPane extends JScrollPane, so it should have inherited the setScrollPosition() method (unless I've got the wrong TableScrollPane ;-))
Yes, you're right.  But there's no setScrollPosition() method.  The one that has setScrollPosition() is ScrollPane class, and JScrollPane extends JComponent, that is another branch from java.awt.Container.  Both ScrollPane and JComponent extend java.awt.Container at the same level.

ASKER CERTIFIED SOLUTION
Avatar of jimmack
jimmack

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial