Text-Componente with fixed width but variable height

N

N. Hamacher

Hi,

i've got an panel with an information section on the left side. This
section is realized as a panel with boxlayout. This panel contains a
text compnonent where i want to put some informations in. The problem
is, that the informations strings have different length so the size of
the text-component has to fit the text. the width has to be fixed (the
whole information sections has a defined width, so the text component).
So just the height can be variated. But i'm just able to set both width
and height so i need a possibility to set just the width!

Maybe someone has a great idea!!

Thanx,

Nico
 
T

Tony Morris

N. Hamacher said:
Hi,

i've got an panel with an information section on the left side. This
section is realized as a panel with boxlayout. This panel contains a
text compnonent where i want to put some informations in. The problem
is, that the informations strings have different length so the size of
the text-component has to fit the text. the width has to be fixed (the
whole information sections has a defined width, so the text component).
So just the height can be variated. But i'm just able to set both width
and height so i need a possibility to set just the width!

Maybe someone has a great idea!!

Here is a brilliant idea: "Use a LayoutManager"
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

There are also many articles available that demonstrate why your approach
(failing to use a LayoutManager) is severely flawed.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top