• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JTable shows previous data

 
Ranch Hand
Posts: 99
Android Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I have problem with my JTable. I have JDialog. which has a JList a JTable and a Ok, Cancle and Help buttons. I am using custom renderes and editor for the JTable. The JTable gets loaded with different models based on the selection on the JList. But the problem is when the user hits the cancel button and invokes the dialog again and selects the previous menu entry then it displays the old value.
Code for the JDialog



The invocation of this dialog is done here.


thanks in advance.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I stubbed–in the missing classes and got your code running. I am unable to replicate the
situation you described. Each time the dialog opens the list has the items in it and the
table is blank. Selecting any list item loads the table with four rows: the rows with
index of zero and 2 in the right–hand column show the selected list item every time.
Clicking either of the OK or Cancel buttons does not seem to alter the result. I am not
able to get a previously–selected or wrong value in the table.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic