Announcement Announcement Module
Collapse
No announcement yet.
[TableFormBuilder] Aligning label in front of JTextArea Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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)



    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:



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

    Comment


    • #3
      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.

      Comment


      • #4
        thats definitly a jgoodies issue. I don't know if this is handled by formlayout or jgoodies looks.

        Comment


        • #5
          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...

          Comment

          Working...
          X