Results 1 to 3 of 3

Thread: GUI Trouble

  1. #1
    rvgsd is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default GUI Trouble

    Hi,
    I am new to JAVA.
    I have two JLabels with having letters different Font Sizes. I just want to align them so that
    the base of the letters are in the same line. Something like this:

    .... IIIIII
    A .. II
    AA IIIIII ------> Same base line

    I tried using Various Layout Managers: BoxLaout, GridBagLayout, but am missing something and I dont want to do it by Trial and Error.
    If someone can help me understand how to do it that woud be great.
    Thanks in anticipation.

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    Maybe FlowLayout.setAlignOnBaseline(...);

    If you need more help post your SSCCE.

  3. #3
    rvgsd is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default Got it

    constraint.anchor = GridBoxLayout.BASELINE;
    did the trick.!

    Thanks anyways.!

Similar Threads

  1. trouble with a class
    By Alexander Montero in forum New To Java
    Replies: 2
    Last Post: 06-17-2009, 11:01 PM
  2. Here comes trouble... :-)
    By sargehendricks in forum Introductions
    Replies: 1
    Last Post: 04-23-2009, 04:18 PM
  3. Trouble with ArrayList
    By John D. in forum New To Java
    Replies: 4
    Last Post: 03-18-2009, 08:43 PM
  4. Got Trouble with JSlider
    By hungleon88 in forum Advanced Java
    Replies: 6
    Last Post: 08-30-2008, 06:02 PM
  5. having some trouble
    By Unknown1369 in forum New To Java
    Replies: 13
    Last Post: 07-22-2008, 12:52 AM

Tags for this Thread

Posting Permissions

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