Results 1 to 3 of 3
  1. #1
    iBowlerHat is offline Member
    Join Date
    Jul 2013
    Rep Power

    Question Help with GridBagLayout please!

    Hi there, I'm trying to create a GUI for a text-based game but I need some help with GridBagLayout.
    The diagram below should explain how I'm trying to layout the components.

    Help with GridBagLayout please!-guidiagram.png

    I want to make it so that player_name, player_image and inventory are labels. Input is an editable TextArea and screen is an un-editable TextArea (It makes it easier to print stuff to the screen if its a text area rather than a label).

    If somebody could please advise me on how to code this that would be wonderful.

    Thanks, iBowlerHat

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: Help with GridBagLayout please!

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

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

    Default Re: Help with GridBagLayout please!

    Primarily, you need to leverage the GridBagConstraints fields gridwidth/height and weightx/y. Lets see your best efforts, in the form of a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates any problem you have in achieving what you want, and we'll help you to fine-tune it.

    Before you post your code, please go through the and BB Code List - Java Programming Forum - Learn Java Programming

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

Similar Threads

  1. GridBagLayout
    By Razion in forum AWT / Swing
    Replies: 4
    Last Post: 05-19-2012, 05:26 AM
  2. GridBagLayout
    By ginger0001 in forum AWT / Swing
    Replies: 3
    Last Post: 03-27-2012, 03:16 AM
  3. [AWT] GridBagLayout Help.
    By Sandia_man in forum AWT / Swing
    Replies: 2
    Last Post: 05-23-2010, 09:54 PM
  4. GridBagLayout
    By Moncleared in forum New To Java
    Replies: 1
    Last Post: 10-18-2009, 11:12 PM
  5. GridBagLayout...please help
    By newtojava7 in forum Advanced Java
    Replies: 1
    Last Post: 02-17-2008, 02:16 AM

Posting Permissions

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