Solved

View the current row in a JdbTable

Posted on 2003-11-12
11
336 Views
Last Modified: 2010-03-31
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.
0
Comment
Question by:paredes_mynor
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9734000
How can you have a 10 row table and be at row 20?
0
 

Author Comment

by:paredes_mynor
ID: 9734018
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.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9734185
You'll need to figure out the height of your rows, the use the setScrollPosition() in the ScrollPane.
0
 

Author Comment

by:paredes_mynor
ID: 9734272
I'm sorry, I didn't undestand your answer.  Another thing, there's no setScrollPosition() method in either JdbTable or TableScrollPane classes.
Thanks.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9734302
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.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:paredes_mynor
ID: 9734356
No, there's none similar to those.  I'll continue looking.  If you find something, I'll appreciate that a lot.
Thks.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9734472
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 ;-))
0
 

Author Comment

by:paredes_mynor
ID: 9734517
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.

0
 
LVL 15

Accepted Solution

by:
jimmack earned 50 total points
ID: 9734647
You're absolutely right.  My apologies.  I'm losing it here.  I could have sworn I was looking at JScrollPane, but obviously not :-(
0
 
LVL 92

Assisted Solution

by:objects
objects earned 200 total points
ID: 9735355
Use :

table.scrollRectToVisible(new Rectangle(0, 0, 1, 1));

And if you want to select the row:

table.setRowSelectionInterval(0, 0);
0
 
LVL 92

Expert Comment

by:objects
ID: 9735460
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bitbucket vs gitbucket 3 57
Groovy:unable to resolve class error 2 70
varialbe initialization 11 30
expectj telnet failing 5 26
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now