This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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: 9993

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!]
subject: jpanel referesh
Similar Threads
a question about JPanel
When there is change in Databse Table data JSP also needs to be refreshed
clear JPanel
form being submitted twice
Displaying a Confermation Message