Results 1 to 4 of 4

Thread: How to use GroupLayout in Java?

  1. #1
    Join Date
    Aug 2006
    Posts
    162

    How to use GroupLayout in Java?

    Hi friends,
    I want your help immediately. I have done some layout managers like flow layout, border layout, etc. But I don't know about the group layout. So thought that posting here would help me.!! Please tell me how to use GroupLayout in Java? Help me as soon as possible.!!
    Processor: AMD Athlon(tm) 64 X2 Dual Core @ ~2.2 GHz
    Memory: 1024MB RAM
    Hard Drive: 200 GB
    Video Card: RADEON X300/X550 Series

  2. #2
    Join Date
    Mar 2008
    Posts
    672

    Re: How to use GroupLayout in Java?

    GroupLayout uses two types of arrangements -- sequential and parallel
    • With sequential arrangement, the components are simply placed one after another, just like BoxLayout or FlowLayout would do along one axis. The position of each component is defined as being relative to the preceding component.
    • The second way places the components in parallel—on top of each other in the same space. They can be baseline-, top-, or bottom-aligned along the vertical axis. Along the horizontal axis, they can be left-, right-, or center-aligned if the components are not all the same size.

  3. #3
    Join Date
    Mar 2008
    Posts
    349

    Re: How to use GroupLayout in Java?

    Components are added to groups by using the addComponent method. :
    Code:
    layout.setHorizontalGroup(
       layout.createSequentialGroup()
          .addComponent(c1)
          .addComponent(c2)
          .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
               .addComponent(c3)
               .addComponent(c4))
    );
    layout.setVerticalGroup(
       layout.createSequentialGroup()
          .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
               .addComponent(c1)
               .addComponent(c2)
               .addComponent(c3))
          .addComponent(c4)
    );

  4. #4
    Join Date
    Aug 2006
    Posts
    235

    Re: How to use GroupLayout in Java?

    The preferred distance of the two components is only used as the minimum size of the gap. See the following sample of coding :
    Code:
    layout.createSequentialGroup()
        .addComponent(c1)
        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,
                         GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addComponent(c2);
    3.2 (northwood)
    2gig ram
    ATI AIW X800xt 256mb
    Gigabyte GA-8knxp 875p Chipset
    Optiwrite 8X DVD Burner
    Win XP PRO Sp2 (Works Perfectly)
    2 SATA Raptor 74gig Raid 0
    2 7200 IDE 320gig HD

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Setting Of Java to The Point At Manual Java
    By winni in forum Software Development
    Replies: 4
    Last Post: 10-01-2011, 10:05 PM
  3. Java Programming using Adventnet SNMP Java API
    By ROCKING_Suhas in forum Software Development
    Replies: 5
    Last Post: 17-07-2010, 06:52 AM
  4. Link List Example in Java Sample program in Java
    By trickson in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 08:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,002,003.27091 seconds with 17 queries