Results 1 to 11 of 11
  1. #1
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    11

    Default Problem in GroupLayout ?

    I have developed one Swing program in my JDK6 sytem by using Grouplayout.
    It works pretty well. But when i try to compile the same program in JDK 5 , I am getting compile time error. This is because JDK 5 does not have GroupLayout Class.
    Is there any JAR available which has GroupLayout class.
    Mak
    (Living @ Virtual World)

  2. #2
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    9

    Default

    No, GroupLayout is part of the Java 6 API which means you cannot use it in earlier versions.

  3. #3
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    11

    Default

    ra4king,

    Is there any way to use GroupLayout in Java 5 by adding external JARs?
    Mak
    (Living @ Virtual World)

  4. #4
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    9

    Default

    No, unless someone makes a jar file containing all new classes added to Java 6 because there might be some new classes that GroupLayout depend on.
    Last edited by ra4king; 04-16-2011 at 09:36 PM.

  5. #5
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    9

    Default

    This is the file, try to see if you can get it working.
    Last edited by ozzyman; 04-26-2011 at 04:56 PM.

  6. #6
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    11

    Default

    ozzyman,

    Thanks for the file. but it shows compiler error in the following import statement.

    import static java.awt.Component.BaselineResizeBehavior;
    import static javax.swing.LayoutStyle.ComponentPlacement;
    Mak
    (Living @ Virtual World)

  7. #7
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    9

    Default

    Those classes are also new in Java 6.

  8. #8
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,807
    Rep Power
    12

    Default

    Solution: stop fannying about. Either upgrade to version 6 or use a different layout manager.

  9. #9
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    11

    Default

    I guess I better use diffent layout manager,dont I?
    Mak
    (Living @ Virtual World)

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    31

    Default

    Quote Originally Posted by makpandian View Post
    I guess I better use diffent layout manager,dont I?
    or layout managers. What GUI configuration are you trying to achieve with all of this? Do you have an example as an image?

  11. #11
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    9

    Default

    They are both very simple (enum) classes...

    Java Code:
        public enum ComponentPlacement {
            RELATED,
            UNRELATED,
            INDENT;
        }
    Java Code:
     public enum BaselineResizeBehavior {
            CONSTANT_ASCENT,
            CONSTANT_DESCENT,
            CENTER_OFFSET,
            OTHER;
        }
    Last edited by ozzyman; 04-18-2011 at 09:08 AM.

Similar Threads

  1. GroupLayout
    By Itun in forum AWT / Swing
    Replies: 3
    Last Post: 03-24-2011, 05:19 PM
  2. GroupLayout Issue
    By m_patten2 in forum AWT / Swing
    Replies: 2
    Last Post: 11-10-2010, 10:50 PM
  3. Anyone know how GroupLayout works?
    By ProgrammingPup in forum Advanced Java
    Replies: 5
    Last Post: 12-01-2009, 11:12 PM
  4. Doubt with GroupLayout
    By emylyano3 in forum AWT / Swing
    Replies: 1
    Last Post: 06-28-2009, 02:16 AM
  5. "Problem With GroupLayout", Please Help !
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-04-2008, 10:29 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
  •