File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 10815

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!]
I agree. Here's the link:
subject: jpanel referesh
It's not a secret anymore!