GUI Component Alignment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • khushib
    New Member
    • Jul 2008
    • 3

    #1

    GUI Component Alignment

    Hello
    I have written a tesing program. Here is a image of that:



    This is how I want it to look like:

    OK(button) on the right side of my first row.

    Snap to Grid(CheckBox), X:(Label), 8(textBox) on second Row

    Rest on third row.

    I tried using setHorizontalAl ignment method from Component class, But it doesn't work.

    Anyone have any thoughts about it?

    Thanks,
    Khushi
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    That's what LayoutManagers are used for.

    Comment

    • khushib
      New Member
      • Jul 2008
      • 3

      #3
      Which LayoutManager would work for me? FlowLayout, GridLayout or BorderLayout... .


      Thanks,
      Khushi

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by khushib
        Which LayoutManager would work for me? FlowLayout, GridLayout or BorderLayout... .
        You have to learn how to play with those layout managers. Maybe three BoxLayout
        managers next to each other can do the job for you. Personally I never use a
        complicated GridbagLayout; check out Sun's tutorials.

        kind regards,

        Jos

        Comment

        Working...