• 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

Cache Problem with Swings

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have swing application (multiple screens to enter user data), here is the probelm and flow.

Step 1 :
Main screen select the user name and enter >>
Ok, If there is an existing data for that user , all the fields will be populated with existing data accordingly(radio button data and text fields), this is edit mode. if no data then user will enter the data and saves to database.

Step 2:
If I go back to main screen and select the diffrent user name who's data not there in the database,... here is the problem ..I get all the fields populated with the old data. so weird ..i dont understand why?
If I close the applet and open again it works fine. I mean if I go back and forth again I get same problem. I hope I explained the problem correctly..PLease suggest some solution !!
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you populating the Swing components - manually calling setText(), setSelected(), etc? Are you sure you cleared (reset) all the components properly at the beginning of the main screen (not at the beginning of the program)?
 
Ashwin Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the problem is i am using singleton class because when I go back and forth in the application it should retain values, for this purpose i am using singleton instance. Yes i am using setText and setSelected methods to set all the values?..If i dont use singleton class then if i go back the selected values are not retained. I really appreciate if you could suggest some solution because I am kinkd of struck here...
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic