Re: Duplicating and Swapping Out A Component
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 11 Mar 2008 01:35:30 GMT
On Tue, 26 Feb 2008 17:11:25 GMT, Hal Vaughan <hal@xxxxxxxxxxx> wrote,
quoted or indirectly quoted someone who said :
Is there some fairly easy way I can duplicate the first JTextArea and swaphow about do the layout with one. do a getBounds on it and do a
the two in and out without messing up other components or the display?
setBounds on the invisible other. Then change the visibility and
trigger a repaint.
When it comes time to flip back, reverse the roles. You don't freeze
the layout with SetMinimum/Maxium/Preferred size to leave it free to
flex except when flipping.
I have flipped using setVisible(). JDisplay does this to flip between
the colour and B&W copy-pastable versions.
However, I have not tried the trick I described.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- Prev by Date: Re: Java GUI
- Next by Date: how to make GUI in java
- Previous by thread: Rivi 1.3 - fast image viewer with very low memory usage (open source)
- Next by thread: how to make GUI in java
- Index(es):
Relevant Pages
|
|