Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic