Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Red face how to refresh the table when a new account is added and display instantly

    hi frnds lot of hurry need urgent help

    i created a table in which students information is displayed as soon as the shell opens and when i click anyone then at the bottom in text boxes i can add a new account.NOW COMES MY PROBLEM,WHEN I ADD A NEW ACCOUNT THE NEW ACCOUNT IS NOT DISPLAYED INSTANTLY IN THE TABLE .I NEED TO LOGOUT N AGAIN SIGNIN TO VIEW THE NEW ACCOUNT.HOW CAN I UPDATE THE NEW ACCOUNT INSTANTLY IN THE ABOVE TABLE.i tried everything like
    con.commit and creating a new method n trying to call tht n display again but nothng is working.i read about firetableX methods in swings but really dont know how to implement

    plzzzzz reply fast

  2. #2
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    try calling repaint() on the JTable after you have added the value

  3. #3
    Cazrin is offline Member
    Join Date
    Dec 2007
    Posts
    16
    Rep Power
    0

    Default

    Although I'm not 100% confident using JTables, I have got *some* working how I want. I take it you're using a custom table model? If you've managed to add the new account to the list your table model is using, you can just use:

    tabelModel.fireTableDataChanged();

    I know it's quite a late reply, but maybe it can still help! Although I don't think it's the most resource friendly function, it's working for me!

  4. #4
    Beemer79R65 is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Smile Solved it for me.

    I was having a similar problem and this solved it for me. I have a custom table model and am constantly changing the data in the model. Thanks very much!
    :p

  5. #5
    FredJavaFreak is offline Member
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0

Similar Threads

  1. how to display the alerts in table
    By geeta_ravikanti in forum JDBC
    Replies: 4
    Last Post: 04-04-2008, 06:45 AM
  2. No datas in added to arraylist
    By Preethi in forum New To Java
    Replies: 0
    Last Post: 02-15-2008, 11:07 AM
  3. Tree with Listener not working when added to ScrollPane
    By praveen.kb in forum AWT / Swing
    Replies: 2
    Last Post: 01-09-2008, 07:06 AM
  4. Data formatting for the <display:table>
    By yuchuang in forum Web Frameworks
    Replies: 3
    Last Post: 12-14-2007, 10:52 AM
  5. Refresh session
    By cachi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •