LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2009, 09:45 PM   #1
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Rep: Reputation: 37
updating a JTable


Hi there,

I have a Java GUI with a JTable and I want to update its data. Can anybody suggest a way of doing it. I have thought to remove the old table using the Container.remove(Component) method and then adding back the new JTable using the Container.add(Component) method. In this way I will probably have to add again any table event listeners.
Does anybody know any other way?

Many thanks.
 
Old 04-01-2009, 11:49 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Java has (an arguably over-complicated) Model-View-Controller design for JTables precisely so you *don't* have to do what you're proposing - precisely so that you *can* change the data independently!

Look at the "TableModel" part of JTable.

This is probably way more information that you want... but there's good stuff here - and useful stuff, too:

http://java.sun.com/docs/books/tutor...nts/table.html

'Hope that helps .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a JTable display multi-level data? paulsm4 Programming 4 05-09-2006 06:44 PM
Making a row being Fixed in JTable MRMadhav Programming 1 03-23-2006 09:06 PM
Java JTable render problem darkRoom Programming 0 02-03-2006 08:32 PM
Motif Look and feel problem for customized jtable object supsnehal Programming 0 10-11-2005 01:45 AM
Java JTable refresh problem dave bean Programming 1 01-06-2005 11:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration