Re: A fixed size window in Java
- From: James McGill <jmcgill@xxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 10:16:44 -0700
On Sat, 2006-04-29 at 15:07 +0000, C. wrote:
Hello. I am writing a Java application with Swing and I need a Window
with a fixed size, because every time I call "pack" because some
components of that window change, the Window is resized to fit exactly
that components.
If I use Frame.setPreferredSize(...) then the components are not shown
correctly when I call pack (some ones are displayed over other ones and
so on).
What can I do to implement a fixed size window?
Thank-you very much.
It might be worth your while to look into JLayeredPane. Instead of a
LayoutManager, it lets you stack things on top of another with specific
Bounds relative to the container. This gives you some control that
regular layout managers don't.
You will still have the same problems if you pack() a container, but if
the LayeredPane's bounds and size getters return the right values, it
will do the right thing.
Lot of work, but any kind of custom layout always is, and LayeredPane is
not that bad...
.
- References:
- A fixed size window in Java
- From: C.
- A fixed size window in Java
- Prev by Date: Re: A fixed size window in Java
- Next by Date: Compiler incompatibility?
- Previous by thread: Re: A fixed size window in Java
- Next by thread: looking for good guide to using ThreadPoolExecutor
- Index(es):
Relevant Pages
|