Results 1 to 4 of 4

Thread: GridBagLayout

  1. #1
    ginger0001 is offline Member
    Join Date
    Mar 2012
    Rep Power

    Question GridBagLayout

    how to create a GridBagLayout on JPanel with 2 rows but different size
    First row is smaller than the second row(First and second row are JPanel)

    I will add small JLabel on first row and add JScrollBar on the second panel
    Please help me
    Last edited by ginger0001; 03-26-2012 at 07:27 PM.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: GridBagLayout

    Please don't post multiple copies of the same question. I've deleted your other thread. I'm also moving this to the Swing forum.

    Recommended reading: Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Rep Power

    Default Re: GridBagLayout

    GridBagLayout is pretty easy to pickup. From what you are describing, you may not need that type of layout, but here is a good example program using GridBagLayout:

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: GridBagLayout

    Quote Originally Posted by sehudson View Post
    ... here is a good example program using GridBagLayout:
    The Oracle tutorial trail linked by Kevin addresses the matter of choice of layout, and a tutorial trumps a nominally commented source code any day.

    And that class is a really bad example of Swing coding.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. GridBagLayout.... help!!!!
    By eiramae in forum Java Applets
    Replies: 5
    Last Post: 02-26-2011, 04:19 PM
  2. GridBagLayout Help
    By Zman3359 in forum AWT / Swing
    Replies: 0
    Last Post: 02-21-2011, 09:39 PM
  3. [AWT] GridBagLayout Help.
    By Sandia_man in forum AWT / Swing
    Replies: 2
    Last Post: 05-23-2010, 09:54 PM
  4. help with gridbaglayout
    By robertbob in forum AWT / Swing
    Replies: 5
    Last Post: 05-18-2010, 05:14 AM
  5. GridBagLayout
    By carderne in forum New To Java
    Replies: 8
    Last Post: 01-25-2009, 03:06 PM

Posting Permissions

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