Skip to main content

what's the best way to refresh a form?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
stern23
Offline
Joined: 2010-10-29

Hello,

Sometimes when I move between forms, or I just show a dialog then back to the form, some of the elements don't show currectly !
Another example when I show a text area with more than one line it shows part of it (but when I open the menu and close it, it shows everything!)..

I guess in such cases I need to refresh my form..
but how to do it ( to refresh the screen/form)?
(Or how the form repainted when I open the menu and close it?)

I tried the following:
form.show()
form.refreshTheme()
revalidate();
repaint();

but nothing worked :)

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
stern23
Offline
Joined: 2010-10-29

To be clear:
My problems start when I show the form then I connect to the internet to fetch some data , after I have the data I create a textArea object and show on screen.
but this TextArea painted in one line (suppose to be more) - if I open my menu and close it the TextArea redraw well (shows all the lines)
somehow it seems the form didn't calculate probably the height of the TextArea when I add it after the form show up

vprise
Offline
Joined: 2003-11-07

If you invoke setText on a text area then call form.revalidate it should layout the form again.