GroupLayout

Hello,
Following my implementation of the GroupLayout Layout Manager recently into my application, I bumped into two problems which I'm not sure how to solve.
My application has different modules, each of which has different number of frames, one which is a tutorial frame which can be made visible or invisible - by checking or unchecking a checkbox. The user also has the option to manually lay the module out or let the program lay it out for him automatically - there's another check box for this as well.
Now the first problem is: when the tutorial frame is not shown and the module is set to manual layout, when I check the check box to show the tutorial frame again, it does not show up.
In order to explain my problem clearer, I've made a test code below, please ignore NetBeans self-generated code:
Please follow these steps to see where the problem lies:
- The program should start up with 4 frames GroupLayedOut and the two menu item check boxes should be checked.
- Please uncheck "Show Ghost Frame" check box. The ghost frame should disappear.
- Then please uncheck "Lay it out" check box. You should be able to move the frames freely now.
- Now check the "Show Ghost Frame" again ... you see, nothing appears. That's the problem.
If you check the two check boxes again, then uncheck the "Lay it out" check box first, then uncheck "Show Ghost Frame", then everything works fine (the ghost frame appears and disappears whenever you check or uncheck the "Show Ghost Frame" check box)
Honestly, I have tried to bypass the problem using different methods but failed. Can you help?
The second problem lies in the commented line in the activateLayout() method. If auto created container gaps and then make the ghost frame disappear by unchecking the "Shwo Ghost Frame" check box, the right hand side will have no container gaps. You can uncomment the line and run the program again and try it out, you'll see the problem
Thanks,
LD

    private void initComponents() {
        thePane = new javax.swing.JDesktopPane();
        frame1 = new javax.swing.JInternalFrame();
        frame2 = new javax.swing.JInternalFrame();
        frame3 = new javax.swing.JInternalFrame();
        ghostFrame = new javax.swing.JInternalFrame();
        jScrollPane1 = new javax.swing.JScrollPane();
        textArea = new javax.swing.JTextArea();
        theBar = new javax.swing.JMenuBar();
        viewMenu = new javax.swing.JMenu();
        layoutMenuItem = new javax.swing.JCheckBoxMenuItem();
        showGhostMenuItem = new javax.swing.JCheckBoxMenuItem();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        thePane.setBackground(new java.awt.Color(255, 255, 255));
        frame1.setResizable(true);
        frame1.setVisible(true);
        javax.swing.GroupLayout frame1Layout = new javax.swing.GroupLayout(frame1.getContentPane());
        frame1.getContentPane().setLayout(frame1Layout);
        frame1Layout.setHorizontalGroup(
            frame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 154, Short.MAX_VALUE)
        frame1Layout.setVerticalGroup(
            frame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 113, Short.MAX_VALUE)
        frame1.setBounds(10, 10, 170, 140);
        thePane.add(frame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
        frame2.setVisible(true);
        javax.swing.GroupLayout frame2Layout = new javax.swing.GroupLayout(frame2.getContentPane());
        frame2.getContentPane().setLayout(frame2Layout);
        frame2Layout.setHorizontalGroup(
            frame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 154, Short.MAX_VALUE)
        frame2Layout.setVerticalGroup(
            frame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 253, Short.MAX_VALUE)
        frame2.setBounds(10, 160, 170, 280);
        thePane.add(frame2, javax.swing.JLayeredPane.DEFAULT_LAYER);
        frame3.setVisible(true);
        javax.swing.GroupLayout frame3Layout = new javax.swing.GroupLayout(frame3.getContentPane());
        frame3.getContentPane().setLayout(frame3Layout);
        frame3Layout.setHorizontalGroup(
            frame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 174, Short.MAX_VALUE)
        frame3Layout.setVerticalGroup(
            frame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 403, Short.MAX_VALUE)
        frame3.setBounds(190, 10, 190, 430);
        thePane.add(frame3, javax.swing.JLayeredPane.DEFAULT_LAYER);
        ghostFrame.setTitle("GHOST FRAME");
        ghostFrame.setVisible(true);
        textArea.setColumns(20);
        textArea.setEditable(false);
        textArea.setRows(5);
        textArea.setText("THIS FRAME\nIS SUPPOSED\nTO\n(DIS)APPEAR\nWHEN THE\nCHECK BOX\nIS \n(UN)CHECKED");
        jScrollPane1.setViewportView(textArea);
        javax.swing.GroupLayout ghostFrameLayout = new javax.swing.GroupLayout(ghostFrame.getContentPane());
        ghostFrame.getContentPane().setLayout(ghostFrameLayout);
        ghostFrameLayout.setHorizontalGroup(
            ghostFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
        ghostFrameLayout.setVerticalGroup(
            ghostFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
        ghostFrame.setBounds(390, 10, 160, 430);
        thePane.add(ghostFrame, javax.swing.JLayeredPane.DEFAULT_LAYER);
        viewMenu.setText("View");
        layoutMenuItem.setSelected(true);
        layoutMenuItem.setText("Lay it out");
        layoutMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                layoutMenuItemActionPerformed(evt);
        viewMenu.add(layoutMenuItem);
        showGhostMenuItem.setSelected(true);
        showGhostMenuItem.setText("Show Ghost Frame");
        showGhostMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                showGhostMenuItemActionPerformed(evt);
        viewMenu.add(showGhostMenuItem);
        theBar.add(viewMenu);
        setJMenuBar(theBar);
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(thePane, javax.swing.GroupLayout.DEFAULT_SIZE, 570, Short.MAX_VALUE)
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(thePane, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)
        pack();
    private void layoutMenuItemActionPerformed(java.awt.event.ActionEvent evt)
        activateLayout(layoutMenuItem.isSelected());
    private void showGhostMenuItemActionPerformed(java.awt.event.ActionEvent evt)
        showGhostFrame(showGhostMenuItem.isSelected());
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new GroupLayoutTest().setVisible(true);
    private javax.swing.JInternalFrame frame1;
    private javax.swing.JInternalFrame frame2;
    private javax.swing.JInternalFrame frame3;
    private javax.swing.JInternalFrame ghostFrame;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JCheckBoxMenuItem layoutMenuItem;
    private javax.swing.JCheckBoxMenuItem showGhostMenuItem;
    private javax.swing.JTextArea textArea;
    private javax.swing.JMenuBar theBar;
    private javax.swing.JDesktopPane thePane;
    private javax.swing.JMenu viewMenu;
}

Similar Messages

  • GroupLayout can only be used with one Container at a time

    Dear all,
    I am a beginner so please don't throw rocks at me...
    I have created two frames with NetBeans. One is the main frame (extends from JPanel) and the other frame I put it to be started when pressing a button from the main frame (the second frame extends from JFrame). Both frames are created using the designer in NetBeans, so the code for creating the GUI is automatically generated by NetBeans, so both frames use the same layout (GroupLayout).
    Here is the code of the button from the main frame to start the second one:
    private void manageCustomersActionPerformed(java.awt.event.ActionEvent evt) {                                                
            // TODO add your handling code here:
            CustomerGUI custGUI1=new CustomerGUI();//CustomerGUI is the second frame
            custGUI1.setVisible(true);
    }When I press this button from the main frame I get this runtime exception: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: GroupLayout can only be used with one Container at a time. The second frame is not opened.
    How should I handle this?
    What I want to do: I want to have a main frame, from which I can start additional ones (the main frame must be always opened, while the additional ones can be closed after performing certain actions). I read a little about internal frames and I think this can be a solution, but I must edit the existing design...
    Thank you
    With respect,
    Don
    Edited by: don1983p on Dec 16, 2008 2:21 AM

    AndrewThompson64 wrote:
    There are those that maintain that JFrame should never be extended. I am not convinced, but most cases where a JFrame is extended would be better coded as simply configuring the JFrame within the main(). GUI builders such as found in NetBeans seem to extend JFrame as a matter of course.I too am not rigorous or religious about this either, but try to adhere to this as a matter of practicality and convenience, I find that if I don't extend a JComponent but rather use composition rather than inheritance, it's much easier to use objects of my class when programming in Eclipse. For instance in Eclipse (and in most IDEs), if I type my object name and then a period, it will show all of the method's available for me to use on this object. If I subclass JPanel or JFrame, I'll see a gazillion methods most I don't want to see, and thus most are clutter. On the other hand if I use composition, I'll only see a small number of methods and these will be only the methods that I want to see and need to use.

  • How to include grouplayout in my .jar file.

    Hello,
    I have a program that works great on my comptuer and the one in my lab. I would like to deploy this .jar file to other systems, but these other systems are only running JRE 1.5.0_10-b03. The problem, as I understand it, is that swing.grouplayout first appeared in JRE1.6.XX so these older versions don't have the proper librairies to run this.
    How do I include the grouplayout class with my .jar file. I have searched all over my HDD and cannot find the grouplayout class file to include. Am I on the right track?
    Thanks!
    -- Snow

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

  • Div tag rendering issue in GroupLayout

    Hi,
    In my jspx page I have div tag to contruct a box with header inside that I am showing some data.
    So I have div class="planHeaderBox" in panelGroupLayout in my jspx1 page and this grouplayout will be refreshed from my bean class when ever I click on button in jspx1 page.
    Issue is every time I click on the button div tage is rendering and adding the headerbox in page(multiple boxes are coming), So how do I make div tag to be executed only once and when ever I click on button
    only the data should get refreshed not the div tag. Do I need to use switcher or any other way do I have?
    Please provide your inputs.
    Thanks in advance.

    That is the reason why you shouldn't do this.
    Can't you get your design using adf tags only?
    Timo

  • GroupLayout in 1.5?

    Heres the deal: I developed a tool in 1.6, using grouplayout, and turns out i need to integrate it into 1.5. I know there is no grouplayout in 1.5, but apparently you can use the swing-layout-1.0.jar file to allow this.
    Problem is: the package contents in swing-layout-1.0.jar is COMPLETELY DIFFERENT than the contents of 1.6 javax.swing.... grouplayout. So refactoring isnt really an option.
    Is there a library out there called "GroupLayoutFor1-5.jar" that has the same locations as the grouplayout in 1.6? Would be really nice if I didn't have to re-code all of my GUI. :(

    Apparently that inner class is required. Check that it's available to the (I assume IDE) or is listed on the classparh.
    HrPeanut wrote:
    Got everything to compile by changing the "layout generation" property in the form.. under the inspector window.
    That did what I was looking for, it will switch between jdesktop, and 1.6 code.
    However, now i'm recieving this odd Runtime error:
    java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
    Exception in thread "main"
    Java Result: 1Which is really strange, considering i'm not using javax.swing.grouplayout ANYWHERE...
    hmmm any thoughts?

  • JDeveloper 11g javax.swing.GroupLayout

    Does JDeveloper 11g support the Swing class javax.swing.GroupLayout ?
    I did not see this class in the layout combo, and when I edited in the source code, I got an error:
    Field groupLayout not found in class oracle.jdevimpl.uieditor.proxy.JPanel
    Thanks a lot.
    John

    Hi,
    its a Java 6 feature and I am afraid to say that we didn't upgrade Swing to Java 6 in this release
    Frank

  • Java.io.NotSerializableException: org.jdesktop.layout.GroupLayout

    Hi All,
    I have a JTree which has re-arrangable nodes. On selection of every node I populate a JTable. Data in JTable is specific to every node. I can add, update and delete rows in JTable. I need to maintain the latest state of the JTable specific to every node. As a result I maintain the TableModel specific to every node in the UserObject related to the node.
    When I set the reference of a model in the UserObject of the tree node and then try to re-arrange the tree nodes I get the following error message:
    java.io.NotSerializableException: org.jdesktop.layout.GroupLayout
    Please help me to solve this problem.
    Thanks in advance.

    shreenivasa wrote:
    swing-layout-1.0.jar added this jar file. Are there any other jar files needs to be in classpath?That's the correct Jar to add, I take it you got in from the Netbeans install directory?
    I would guess the problem is your Manifest file, you have probably exported this from
    Netbeans but don't have the Jar on your classpath or it cant be found in the place you
    specified in your Manifest
    GroupLayout was added to J2SE 6 as a standard class so this might be better to change to this
    than your current approach if your clients use this Java version. It's one less jar to bundle with your app.

  • How to use GroupLayout in LWUIT

    Hello!
    Please, show me complex example of using GroupLayout. How can I add GroupLayout to the other layout as a component, or how can I add some layout to the GroupLayout as a component?
    Thank you,
    Nick.

    My Question: Are you using Netbeans? If yes it is not a good idea to use its GUI. It generates the GroupLayouts and it is hard to understand them for a beginner. My suggestion: Use GridbagLayout instead of GroupLayout. It is easier.

  • GlassFish: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$

    Hi,
    I am new to java, liked the tool nebeans and want to shift to it.
    I created a desktop swing application containing one blank form only, set its property to run on JWS. It works fine, then I created a project for deploying the app on GlassFish. Verified it, it gave no error. But on launching the app from GlassFish V2 b58g, I get following error;
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at com.sun.enterprise.appclient.jws.boot.JWSACCMain.run(JWSACCMain.java:218)
         at com.sun.enterprise.appclient.jws.boot.JWSACCMain.main(JWSACCMain.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
         at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:454)
         ... 15 more
    Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
         at java.lang.Class.getMethod0(Unknown Source)
         at java.lang.Class.getMethod(Unknown Source)
         at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:236)
         at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:417)
         ... 15 more
    Please help me out.
    Thanks
    Krishnan

    krishnan wrote: I am new to java, liked the tool nebeans and want to shift to it.
    Since, at one post, it seems you are not just new to Netbeans, Java and JWS, but also the Sun forums, I will take this moment to point out that adding Dukes to a question encourages replies, and can be done at any point in a thread.
    krishnan wrote: Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group ..
    This is usually caused by the lack of the Jar containing the named class, in the application classpath. The application classpath is specified in the JNLP file.
    GroupLayout is also a Netbeans specific class. I recommend coding most GUIs in core J2SE layouts, to avoid you having to supply the Jar, and the user to download it.
    If you try to add the jar without success, it would be helpful to know the basic 'layout' of the server (e.g. describe where all the resources, including the JNLP file(s) and jar(s) are located) and the content of the JNLP file.
    Note also that Netbeans makes horrid JNLP files. You are better off writing your own and ensuring Netbeans never gets the idea it is expected to edit it. You can do this by abandoning some of the 'click a button' ease that you apparently quite like, and using Ant to build and deploy the project.
    Ant adds a bit more learning, but is well worth the effort, as projects that can be worked on in Netbeans, can also be worked on using Eclipse (and every other IDE that supports Ant), or can be built from the command line.

  • GroupLayout from 1.6 under 1.5

    I've written a bunch of GUI stuff in Netbeans, source code level 1.5 but it's used the 1.6 GroupLayout. The 1.5 GroupLayout code from the swing-layout jar is in a different classpath location so I can't just use the jar.
    I've been given a requirement to get this code to run on a Mac - which it seems 1.5 is the only realistic option for. How can I get this 1.6 code to run under a 1.5 VM without redesigning it all?
    Incidentally I'd be interested in what would happen with GroupLayout used under 1.5 migrating to 1.6 - would you have to retain the jar and not benefit from the 1.6 updates? Thanks.

    Achim,
    No need to change htmldbins.sql or any other file. You can upgrade your 1.5 installed in 9.2.0.4. Just follow the documentation.
    Sergio

  • I cant see  GroupLayout in javax.swing.

    What i doing wrong?
    Thanks

    javax.swing.GroupLayout is since version 1.6.
    {color:#000080}If you are getting an error when trying to import the class, you have an earlier version of the jdk.
    If you cannot see the class in the documentation, you are referring to the documentation for an earlier version.{color}
    http://java.sun.com/javase/6/docs/api/javax/swing/GroupLayout.html
    {color:#000080}db{color}

  • Swing GroupLayout Error()

    Hello,
    I have an exception in my Japplet and i can`t find the problem. Can somebody find the exception.
    Thanks in advance
    Bart
    This is the exception:
    Exception in thread "main" java.lang.IllegalArgumentException: Component must be non-null
    at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2878)
    at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2858)
    at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1490)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2414)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2384)
    at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1471)
    at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2406)
    My Code:
    package gui;
    import javax.swing.*;
    import java.awt.*;
    public class Gui extends JPanel {
        * File:         Gui.java
        * Version:      1.0
        * Description:  The Gui of a simple spot editing tool for the web.
        * @author       Bart
        * Date:         30-10-2008
        @SuppressWarnings("unchecked")
        private JButton btnPost;
        private JLabel lblSpotter;
        private JLabel lblDatum;
        private JLabel lblTijd;
        private JLabel lblVogelsoort;
        private JLabel lblLocation;
        private JLabel lblFoto;
        private JLabel lblCommentaar;
        private JLabel sl1;
        private JLabel sl2;
        private JLabel dp1;
        private JTextField inputSpotter;
        private JTextField inputDag;
        private JTextField inputUur;
        private JTextField inputVogelsoort;
        private JTextField inputMaand;
        private JTextField inputJaar;
        private JTextField inputMin;
        private JTextField inputLocAB;
        private JTextField inputLoc1234;
        private JTextField inputLoc5678;
        private JTextArea inputCommentaar;
        private JScrollPane jScrollPane1;
         * Method: Constructor Gui
         * Description:
        public Gui() {
         * Method: Constructor Gui
         * Description:
        private void init() {
            this.setVisible(true);
         //buttons
         btnPost = new JButton("Verzend");
         //labels
         lblSpotter = new JLabel("Spotter: ");
            lblDatum = new JLabel("Datum: ");
            lblTijd = new JLabel("Tijd: ");
            lblVogelsoort = new JLabel("Vogelsoort: ");
            lblLocation = new JLabel("Location: ");
            lblCommentaar = new JLabel("Commentaar: ");
            sl1 = new JLabel("/");
            sl2 = new JLabel("/");
            dp1 = new JLabel(":");
         //textfields & areas & scrollpane
         inputSpotter = new JTextField();
            inputDag = new JTextField();
            inputUur = new JTextField();
            inputVogelsoort = new JTextField();
            inputMaand = new JTextField();
            inputJaar = new JTextField();
            inputMin = new JTextField();
            inputLocAB = new JTextField();
            inputLoc1234 = new JTextField();
            inputLoc5678 = new JTextField();
            inputCommentaar = new JTextArea();
            inputCommentaar.setColumns(20);
            inputCommentaar.setRows(5);
         jScrollPane1 = new JScrollPane();
            jScrollPane1.setViewportView(inputCommentaar);
         //grouplayout & adding labels,textfields,textareas to layout
            GroupLayout layout = new GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addComponent(lblCommentaar)
                        .addGroup(layout.createSequentialGroup()
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                .addComponent(lblVogelsoort)
                                .addComponent(lblLocation)
                                .addComponent(lblTijd)
                                .addComponent(lblDatum)
                                .addComponent(lblSpotter)))
                        .addComponent(lblFoto))
                    .addGap(7, 7, 7)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
                        .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                .addComponent(inputDag)
                                .addComponent(inputUur, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                .addComponent(sl1)
                                .addComponent(dp1))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                .addComponent(inputMin, GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
                                .addComponent(inputMaand))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(sl2)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputJaar))
                        .addComponent(jScrollPane1, GroupLayout.Alignment.LEADING)
                        .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(inputLocAB, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputLoc1234, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputLoc5678))
                        .addComponent(inputSpotter, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
                        .addComponent(inputVogelsoort, GroupLayout.Alignment.LEADING)
                        .addComponent(btnPost))
                    .addContainerGap(31, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(26, 26, 26)
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(lblDatum)
                                .addComponent(inputDag, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputMaand, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputJaar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(inputLocAB)
                                .addComponent(inputLoc1234)))
                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(lblSpotter)
                            .addComponent(inputSpotter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblTijd)
                        .addComponent(inputUur, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputMin, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(dp1))
                    .addGap(7, 7, 7)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblVogelsoort)
                        .addComponent(inputVogelsoort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(lblLocation)
                        .addComponent(inputLocAB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputLoc1234, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inputLoc5678, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                        .addComponent(lblCommentaar)
                        .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE))
                    .addGap(6, 6, 6)
                    .addComponent(lblFoto)
                    .addGap(21, 21, 21)
                    .addComponent(btnPost)
                    .addContainerGap())
          * Method: Start
          * Description:
         public void start() {
          * Method: Stop
          * Description:
         public void Stop() {
          * Method: Destroy
          * Description:
         public void destroy() {
         public static void main(String args[]){
              Gui gui = new Gui();
                    gui.init();
    }

    I`ve changed JPanel into JApplet and init() into go() ,and start(),destroy() and stop() are disabled.
    But at the end i want to have the applet into a webbrowser. And i can`t find the error, GroupLayout layout - new GroupLayout(this) seems good in my vision. The error is on the "this" part, is it possible to give the this a value?
    Complete Exception
    Exception in thread "main" java.lang.IllegalArgumentException: Component must be non-null
            at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2878)
            at javax.swing.GroupLayout$ComponentSpring.<init>(GroupLayout.java:2858)
            at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1490)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2414)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2384)
            at javax.swing.GroupLayout$Group.addComponent(GroupLayout.java:1471)
            at javax.swing.GroupLayout$ParallelGroup.addComponent(GroupLayout.java:2406)
            at gui.Gui.init(Gui.java:98)
            at gui.Gui.main(Gui.java:212)
    Java Result: 1Thanks in advance,
    Bart

  • Where is javax.swing.GroupLayout Class....?

    In the Java 6 Doc I am getting the information about javax.swing.GroupLayout class. But I cpuld not find the class in Jar.
    Am I missing something?
    It will be appriciated If you help me to finding the Jar file for this class.
    Thanks.

    Thanks for help.
    I have got it. As I am using beta version of Java6 in which that class was missing. In the latest version of JDK , I have found that class.

  • Javax.swing.GroupLayout - problem

    Hi
    Puzzling problem has occurred when developing the same application on different PC�s and using the same IDE (Netbeans 5.5) on both.
    The problem is that the �javax.swing.GroupLayout� class is being used when inserting netbeans GUI components on one of the PC�s. However, the other PC uses �org.jdesktop.layout.GroupLayout� and generates an error when trying to compile the �javax.swing.GroupLayout� components. It cannot find the javax.swing.GroupLayout� class.
    The jdk is jdk 6 for both.
    Can anyone shed any light on this?
    Regards
    GB

    Did you check the project properties?
    Project properties | Categories: Libraries --> Java Platform: JDK 1.6
    (javax.swing.GroupLayout works only with 1.6)

  • GroupLayout Platform Differences

    Working on a project and started on a PC but moved it over to my Mac while traveling. When I opened the project, my main form had a bunch of errors.
    I created the project using NetBeans 6.5 and I have a couple of jInternalFrames on the form. Looking at the generated code from the PC, it starts with:
    javax.swing.GroupLayout fra_HandicapLayout = new javax.swing.GroupLayout(fra_Handicap.getContentPane());When I opened in on my Mac, again in NetBeans 6.5, that shows as an error saying it can't find GroupLayout in the javax.swing.
    Just for grins, I created a new form on the Mac and then copy/pasted the frame from the "bad" form onto the new form. Looking at the code on the Mac, it now starts with:
        org.jdesktop.layout.GroupLayout fra_HandicapLayout = new org.jdesktop.layout.GroupLayout(fra_Handicap.getContentPane());So the question is, why? I'm still a bit new to Java and was under the impression that it should be platform independent. My guess is that I have some additional (or missing) library between the two platforms but I wouldn't know where to go to start looking.
    Can anyone shed any light on this? Does anyone know if the org.jdesktop.layout.GroupLayout would work on the PC?
    Thanks!!!!

    ShosMeister wrote:
    I didn't even think to look at the JDK. Thanks!!! That was it. I'm using 5.x (or so) on the Mac. Opened the .java file in Xcode and changed all of the javax.swing to org.jdesktop.layout and then opened it back up and changed it as you suggested from Standard Java 6 to Swing and looks like it's all working fine.
    You don't need to manually change that code. It should be done automatically when you change that property.
    Guess I need to either roll-back the JDK on the PC or upgrade the Mac to keep compatible? What is the more common looking ahead to a distribution package, 5 or 6?If you can use v6, use v6, it's newer and more feature rich. :-)

  • Org.jdesktop.layout.GroupLayout Error..

    org.jdesktop.layout.GroupLayout is a class used in Netbeans ide and is used for specifying the layout of the controls on the form.. how do i use this when im building my application in notepad..
    Thanx in advance..

    http://java.sun.com/docs/books/tutorial/uiswing/layout/group.html

Maybe you are looking for

  • Gradient disappears from pdf in Illustrator

    I created a logo graphic in Illustrator, placed that into an InDesign file for text formatting and exported as a pdf. When the customer sent it to get printed (silk screen) onto shirts, the gradient in the logo vanished.  The printer was opening and

  • Automatic clearing creteria

    Hi, Is there any transaction to maintain automatic clearing creteria that the user can use directly in the production system ? PS : The transaction OB74 doesn't meet our need Please help Regards.

  • Too many values.Not displaying all the data

    Hi All,         I have facing the problem, while showing the map for different location. It says that Too many "ColumnName" Values. I cant find any where what is the limitation while representing the maps....... Please share any one have aware of it.

  • How to rename playlists?

    I can't seem to change the name on playlist I've created in iTunes on my ipad. Is that correct? Surely I must be able to change it without having to delete it and set up a new one?

  • Inverted Question Mark

    Hi All, In forms 10g when we had entered pound symbol in a text item (using alt + 156) it comes exactly as pound and i am able to save and re-query it. But when the same is inserted through a insert script through sqlplus the pound symbols comes as i