Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in erasing panel

 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i am new in java n getting this problem

i want to create a program in which i am retrieving data from database and showing in gui frame but i want when submit pressed old frame's data should be get erased but instead of that it appends in that

thank you for your help


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of disposing/recreating everything,
just change the text of the question label
and the four answer radiobuttons
 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:Instead of disposing/recreating everything,
just change the text of the question label
and the four answer radiobuttons


that is changed every time i press submit

but still old data are still in panel didnt erased out
 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your launch() method should NOT create components.

It should do the database query and then update existing components on the frame by using setText(), setModel() or whatever method is used to change the data in an existing component.
 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Your launch() method should NOT create components.

It should do the database query and then update existing components on the frame by using setText(), setModel() or whatever method is used to change the data in an existing component.


i make different function and it works thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic