Text-Componente with fixed width but variable height

Discussion in 'Java' started by N. Hamacher, Apr 29, 2004.

  1. N. Hamacher

    N. Hamacher Guest

    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
    N. Hamacher, Apr 29, 2004
    #1
    1. Advertising

  2. N. Hamacher

    Tony Morris Guest

    "N. Hamacher" <hamacher_@_techinfo.rwth-aachen.de> wrote in message
    news:4090E990.9020406@_techinfo.rwth-aachen.de...
    > 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)
    Tony Morris, Apr 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eduard Faschang

    HTML Componente upload

    Eduard Faschang, Apr 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    293
    Eduard Faschang
    Apr 9, 2004
  2. johnp
    Replies:
    4
    Views:
    3,645
    Toby Inkster
    May 23, 2005
  3. ssk
    Replies:
    5
    Views:
    5,445
    Jukka K. Korpela
    Oct 30, 2006
  4. HP
    Replies:
    3
    Views:
    405
    Ben C
    Mar 9, 2007
  5. cera
    Replies:
    1
    Views:
    1,235
    Neredbojias
    Aug 18, 2007
Loading...

Share This Page