Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cache Problem with Swings  RSS feed

 
Ashwin Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • 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 !!
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • 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
  • 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...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!