Solved

View the current row in a JdbTable

Posted on 2003-11-12
11
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login form jsp example 2 67
program arguments vs VM arguments 4 53
JDBC performance 8 32
JVM error from eclipse 1 22
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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…
Suggested Courses

740 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