Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2008, 06:22 PM
Member
 
Join Date: May 2008
Posts: 1
robbertds1 is on a distinguished road
JTable problem
Hi there,

In my program I use a JTable thats in a Jpanel to list all my users on it.
There is also a posibility to delete one of those users.
But then the problem starts the JTable stays like it is and I want to refresh it. I know there is a JLissener or something but I dont know how that works.
Is there also another posibility to refresh the panel or Jtable to update my data for the Jtable.
also the option revalidate with a panel seems to doesnt work :s

Can someone please help me
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-20-2008, 07:34 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,054
hardwired is on a distinguished road
The JTable listens to the TableModel so it can know when to update itself. Use a DefaultTableModel and make data additons/deletions to it. Depending on the methods you use you may have to use a method in the AbstractTableModel class to announce the change(s). The table will hear about the changes.
Put the JTable in a JScrollPane and eliminate the JPanel. Add the scrollPane to the container that you had added the panel to earlier. JTable implements the Scrollable interface so it knows how to communicate with the parent scrollPane.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help salmanpirzada1 Advanced Java 2 05-15-2008 11:15 AM
Problem with jTable that is binded with a table in MySQL Database rajkenneth NetBeans 0 03-29-2008 04:36 PM
Sorting JTable (Vectors) Problem ramapple AWT / Swing 5 02-05-2008 09:54 AM
problem in redrawing JTable abhinav AWT / Swing 0 11-21-2007 10:08 PM
Problem with JTable Felissa AWT / Swing 2 07-04-2007 10:25 AM


All times are GMT +3. The time now is 08:32 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org