The moose likes Swing / AWT / SWT and the fly likes jpanel referesh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jpanel referesh" Watch "jpanel referesh" New topic

jpanel referesh

sa sam
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
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

Joined: Jul 26, 2007
Posts: 10167

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 ;)

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
wood burning stoves
subject: jpanel referesh
Similar Threads
Displaying a Confermation Message
clear JPanel
When there is change in Databse Table data JSP also needs to be refreshed
form being submitted twice
a question about JPanel