🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9559

Getting a table to scroll a new row into view

#9559
From: E Steel
Date: Mon, 28 Feb 2000 00:00
21 lines
1436 bytes
Hello,
    I'm new to this newsgroup and java, so here's my question!
    Using JBuilder 3 with jdk 1.2.2 on Windows NT

    I have a JTable in a JScrollPane with a vertical scrollbar with
autoScrolls set to true, with a subclassed DefaultTableModel that does
not allow editing in column 1 of the table. What I want to do is when I
add a row to the table I want it to scroll into view.
    When I do:
            MyTabelModel tableModel.addRow()
                    No scrolling takes place
            I added the following line of code after the addRow()
                JScrollPanel.getVerticalScrollBar().setValue
(JScrollPanel.getVerticalScrollBar.getMaximum());
            The table scrolls to just before the new row, but the new
row does not scroll into view.

Any help would be greatly appreciated.

                                                    Ed Steel
(steel@tis4000.com)
Technical Details
Message-ID: <38BABB60.C129836@tis4000.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9816815c546accd2,start
X-Google-Attributes: gid111d45,public
From: E Steel <steel@tis4000.com>
Subject: Getting a table to scroll a new row into view
Date: 2000/02/28
Message-ID: <38BABB60.C129836@tis4000.com>
X-Deja-AN: 590946657
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing