Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jpanel referesh

 
sa sam
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have 8 text fields 3 combobox & 2 buttons (1st update & 2nd is clear ) in jpanel.

i want to set them at there default state when i click on clear button.

i dont want to write "text1.settext(" ");" code for every field.

in short i want to referesh my jpanel.

is there any shortcut.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only shortcut is to have a method which does the setting all the fields to the default state and call that method whenever you want to refresh the panel.
Write once, invoke anytime ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic