Results 1 to 3 of 3
  1. #1
    Shellback3 is offline Member
    Join Date
    Jan 2011
    Location
    Riveside, CA
    Posts
    16
    Rep Power
    0

    Default Using a grid to place objects

    I'm not new to programming but new to Java and am teaching myself. I'm really new to Swing/AWT and have always created GUIs in C/C++ and Delphi using a WYSIWYG IDE.

    I've created a GUI that displays 1 to n rows of three object: a JLabel, a JTextField, and another JLabel. The first column of JLabels determine the width of the grid columns. I'd like to adjust the width of the other two columns down as the text displayed are short strings, no longer than an IPV6 address and it would look better. :)

    Is this possible?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Either of SpringLayout or GridBagLayout may be suitable for your requirements.

    db

  3. #3
    Shellback3 is offline Member
    Join Date
    Jan 2011
    Location
    Riveside, CA
    Posts
    16
    Rep Power
    0

    Default Oh, oh

    Either of SpringLayout or GridBagLayout may be suitable for your requirements.
    Wow, I think I'll put this off for a while as I'm still working to complete the app, the appearance is not my first priority, and it appears that this code will add complexity at the wrong time in the development. Seeing GridBagLayout referred to as GridBugLayout gives me pause! :eek:

    This app is the most complicated Java I've attempted and is still teaching me a lot about generic objects, reflection, and swing so I'd better concentrate on finishing it.

    Thanks for your reply.

Similar Threads

  1. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 2
    Last Post: 11-03-2009, 05:27 PM
  2. Replies: 0
    Last Post: 03-10-2009, 09:55 AM
  3. Replies: 1
    Last Post: 01-22-2009, 04:25 PM
  4. How do i place objects onto a grid?
    By Nakira in forum New To Java
    Replies: 7
    Last Post: 11-14-2008, 06:49 PM
  5. how to get the grid values
    By jazz2k8 in forum Advanced Java
    Replies: 2
    Last Post: 11-06-2008, 02:11 PM

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
  •