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. Advertisements

  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. Advertisements

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:
    354
    Eduard Faschang
    Apr 9, 2004
  2. Replies:
    11
    Views:
    1,308
    Toby Inkster
    Jan 28, 2005
  3. johnp
    Replies:
    4
    Views:
    3,956
    Toby Inkster
    May 23, 2005
  4. ssk
    Replies:
    5
    Views:
    6,329
    Jukka K. Korpela
    Oct 30, 2006
  5. HP
    Replies:
    3
    Views:
    591
    Ben C
    Mar 9, 2007
  6. cera
    Replies:
    1
    Views:
    1,618
    Neredbojias
    Aug 18, 2007
  7. Replies:
    1
    Views:
    914
    Beauregard T. Shagnasty
    Dec 29, 2007
  8. Bernd Meier
    Replies:
    6
    Views:
    688
    GTalbot
    Jan 14, 2008
Loading...