JTable GoToRow(int i)

Hey, I have searched the web up and down, and cannot find how to do this.

I've got a JTable. It's part of an app that listens for new orders coming in. Whenever an order comes in, it gets recorded in the table in the next available row... as expected.

once I get more orders than I can see, I want my app to preferrably automatically display the last filled row.

I am willing to settle on having a button that simply goes to the last filled row.

any ideas?

[490 byte] By [grozniy_99a] at [2007-11-27 6:51:36]
# 1
i have done this before, i dont remember exactly how, but i think it was something like this: jtable was inside of a jscorllpane, i used jscrollpanes autoscrolling to do the work for me. search the web some more, im sure i found my solution from the webs.
mkoryaka at 2007-7-12 18:26:04 > top of Java-index,Java Essentials,Java Programming...
# 2
AutoScrolling is enabled, but it still doesn't work.
grozniy_99a at 2007-7-12 18:26:04 > top of Java-index,Java Essentials,Java Programming...
# 3
Have you tried using the JScrollBar methods setValue and getMaximum when a new row is added? According to the api, it sounds like that might work.
hunter9000a at 2007-7-12 18:26:04 > top of Java-index,Java Essentials,Java Programming...
# 4

> Hey, I have searched the web up and down, and cannot find how to do this.

Well, you are searching the wrong forum. Swing related questions should be searched for and posted in the Swing forum where this question has been asked and answered before.

Basically you use the table.scrollRectToVisible(...) method.

camickra at 2007-7-12 18:26:04 > top of Java-index,Java Essentials,Java Programming...