Results 1 to 5 of 5

Thread: [TableFormBuilder] Aligning label in front of JTextArea

  1. #1
    Join Date
    Jul 2006
    Posts
    106

    Unhappy [TableFormBuilder] Aligning label in front of JTextArea

    Hi,

    I think this should be a very common problem:
    (Take a look at the JLabel in front of the JTextArea)

    alignTextArea.png

    I use the following code:
    Code:
        final SwingBindingFactory bindingFactory = ( SwingBindingFactory ) getBindingFactory();
        TableFormBuilder formBuilder = new TableFormBuilder( bindingFactory );
        formBuilder.addSeparator( "general" );
        formBuilder.row();
        formBuilder.add( Article.PROPERTY_HEADLINE );
        formBuilder.row();
        formBuilder.add( Article.PROPERTY_AUTHOR );
        formBuilder.row();
        formBuilder.addSeparator( "content" );
        formBuilder.row();
        formBuilder.addTextArea( Article.PROPERTY_HEADLINE );
    But I think it should look like this:
    jgoodies.png


    Just one remark: I know this is just a small problem. And many technician don't care about it.
    But those issues are very, very important for all those guys that pay the money for the work we do . They don't understand the great architecture - and they don't care. But they *see* the application.
    So I think the great work on the UI (I love the TitledApplicationDialog) should be continued.

  2. #2
    Join Date
    Apr 2006
    Location
    Germany, Berlin
    Posts
    61

    Default

    you can define default attributes for the labels:

    Code:
    formBuilder.setLabelAttributes("colGrId=label colSpec=right:ref");

    every field you add after that call will be aligned to the right side.

    You can use any colSpec or rowSpec definition from JGoodies' Formlayout.
    ___
    Mathias

  3. #3
    Join Date
    Jul 2006
    Posts
    106

    Default

    Arghl, sorry for my mistakable posting.
    I mean the *vertical* alignment. The baseline of the label "Headline:" does not fit to the baseline of the first line of the JTextArea.

  4. #4
    Join Date
    Apr 2006
    Location
    Germany, Berlin
    Posts
    61

    Default

    thats definitly a jgoodies issue. I don't know if this is handled by formlayout or jgoodies looks.
    ___
    Mathias

  5. #5
    Join Date
    Jul 2006
    Posts
    106

    Default

    Yes, this definitly is related to JGoodies forms.

    But the baselines are aligned when the JGoodies builder is used (see the attached image of the JGoodiesDemo).
    So I think there must be some sort of shortcoming within the TableFormBuilder.
    And I think (nearly) everybody will run into the same troubles as soon as he uses a JTextArea...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •