Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Jtable add rows to top instead of bottom

Thread view: 
andrina.luczon@gmail.com - 28 Jun 2006 22:07 GMT
I'm creating an error/warning message table. Every time an error or
warning is generated, the row count increases by one and the value of
the newly added row value is set to the message.

However, when the new row is added, it is added to the bottom of the
list. The user is not aware that a new message is added unless they
scroll down to the bottom of the table.

Is there a way to add new rows to the top of the table (without doing
tons of shifting)

Or is there a way to set the focus to bottom of the table, so that if
more rows are added, the scroll will automatically scroll down to the
most recently added row?

Hope that makes sense.... any help is appreciated.
Andrey Kuznetsov - 28 Jun 2006 22:39 GMT
> I'm creating an error/warning message table. Every time an error or
> warning is generated, the row count increases by one and the value of
[quoted text clipped - 3 lines]
> list. The user is not aware that a new message is added unless they
> scroll down to the bottom of the table.

DefaultTableModel#insertRow(int row, Object [] rowdata);

Andrey

Signature

http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

Lionel - 28 Jun 2006 22:58 GMT
> I'm creating an error/warning message table. Every time an error or
> warning is generated, the row count increases by one and the value of
[quoted text clipped - 12 lines]
>
> Hope that makes sense.... any help is appreciated.

If you have some sensible order then you might consider looking at
extending AbstractTableModel. It makes life much easier.

Lionel.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.