[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

View the current row in a JdbTable

Posted on 2003-11-12
11
Medium Priority
?
373 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 200 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 800 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

656 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