Swing layout

in AWT, the layout was control by the GridBag Layout and constraints, how can i control the layout of the button in swing to the layout that i want it to be?

hi,
everyone has this problem at first :) ...
you need to set your Layout to null rather than GridBag or whatever...
then on each component (button,label etc) you can call the .setBounds() method.
this takes 4 ints i think...x,y,width,height so you can positition the things wherever you want then
alexs

Similar Messages

  • Unable to run jar file without lib folder containing swing-layout-1.0.jar

    I have done my project through NetBeans 5.0. Eventhough I have copied my lib foloder containing swing-layout-1.0.jar inside my project.jar, I am still unable to run my project.jar in other systems, it is creating an error as Could not find the main class. Program will exit. But if I copy the lib foloder containing swing-layout-1.0.jar in the same path as the project.jar, then my project.jar is running.
    But I want to give only the project.jar for other users and not also lib foloder containing swing-layout-1.0.jar each time.
    Could someone please help me with this.

    When you develop GUI applications using the Netbeans you may endup using netbeans specific jar files in your auto generated code.
    And when you build jar files with netbeans it copy the third party jar files used in a application in to a lib folder in the same directory as the jar file of your project. And then set a class path entry to those jar files in your project jar file's manifest file.
    So if you want to redistribute the package you have to redistribute your jar file and every thing in the lib folder in with the same directory structure.
    If you want to change the structure you will have to change the class path to suit the new structure.

  • Swing Layouts

    Why is laying out component sizes in Swing so incredibly opaque?
    Each time I build a swing interface it seems to be a series of visual compromises, and ending up in more TLOC than any other part of even a complex application. Changing one value seems to always mess up everything else or have unexpected side-effects! Half the time, changing the most obvious values have no effect at all. I frequently end up just clearing out ALL layout hints/settings from the UI and starting from scratch with a GridBagLayout just to get something fairly sensible. Yes I am frustrated.
    If any part of the increasingly wonderful java platform needs a major review, then it is the Swing layout APIs or at least the documentation of the exact behaviour and dependencies of methods that influence sizes.
    Either I am stupid (which I would be most willing to accept), or component layout/orientation/sizing/behaviour is very, very far from intuitive.
    I'd love to become a Swing-super-guru-expert, but as I am expected to be an expert on so many other things, I simply do not have the time to spend on it. I believe that it would be much better for the platform as a whole if the UI platform was made more intuitive or at the very least much better documented.
    I am seriously considering moving to SWT, as I just don't have the time or energy to figure all this out.
    /k1

    Oh btw - all the GUI editors I've ever used tend to compound the problems by introducing their own
    quirks, dependencies and restrictions! That's been my experience to date which is why I've steered clear of them.
    As far as swing architecture not being mature. I think the architecture gives you the building blocks, from there any layout mangers can be created. Maybe Sun could provide a few more LayoutManagers but I suspect their tactic is to provide the minimum from which you can do everything so keeping the API size down.
    So don't restrict yourself to those available in the JDK. Have a google and get some freebies. There are all sorts of alternative Layouts there. The fact that these are freely available elsewhere is quite likely why SUn haven't bothered to introduce more themselves some that spring to mind are TableLayout, GridLayout, ProportionalLayout, LabelledLayout
    To my mind it's the beauty of swing that allows it to be so easily extended in this way.
    SpringLayout came in in JDK1.4 http://www.onjava.com/pub/a/onjava/2002/09/11/layout.html but I'm not familiar with that as yet as I write systems that must be JDK1.3 compatible. It looks like a better replacement for GridBagLayout there are probably alternative versions of this to be found on the web..

  • Swing layout error

    i have posted this in the jdbc forum but i have not recieved any responsed yet so im posting it here in the hope that one of you might
    have a solution.
    I searched this forum, and i was surprised to find that none had this problem. I ll get to the point.
    I am using netbeans, so i downloaded the mysql driver , added it to the project library and compiled and ran my program . I did not have any problems.
    so i triedt to run the app on a different machine and it gave me the
    popular swing layout error. I fixed that error. by adding some lines to the xml file mentioned in the netbeans faq.
    Now it gives me another popular error when i try to run the .jar file from command line on the same machine i developed the app
    the errror is
    System Exception Output : com.mysql.jdbc.Driver
    is there a way to avoid this error like the swing layout error
    thanks in advance

    So, nothing whatsoever to do with a Swing layout error, then :o)

  • Swing layout books ?

    Hi,
    We are a small group of developers and have written quite a lot of Java apps and GUIs, but seems to struggle sometimes getting good layouts on forms etc that we are designing. We obviously know about the different layout managers but i'm not sure we're using them fully or really know them inside out. What we're looking for is more information about how to get the best layouts, tips and tricks, or a complete treatise on the layout managers.
    Can anyone recommend a good book on using Swing layout managers, and/or general GUI design principles ? The Sun tutorial is a pretty good start, but is there anything else ?
    Many thanks
    Alistair

    hi,
    Professional Java Programming in this link,(but not free download)
    http://www.amazon.com/Professional-Java-Programming-Brett-Spell/dp/186100382X

  • Swing layout/size problem with JFrame and JApplet.

    I have a class that extends a JFrame, the classes layout is BorderLayout. I then have a class that extend JApplet, this classes layout is GridBagLayout (this class has a JTabbedPane - which contains JPanels). The problem I'm having is no matter how big I make the size of the applet or frame (using setSize), the applet/frame stays the same size - no matter how large I make it.
    Can anyone please help?
    Thanks,
    dosteov

    Here is the basic code:
    Thanks in advance,
    dosteov
    public class EADAdm extends JApplet
    EADAdmFrame theFrame = new EADAdmFrame(this);
         public void init()
              // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
    //          symantec.itools.lang.Context.setApplet(this);
              // This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
              getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
              // This code is automatically generated by Visual Cafe when you add
              // components to the visual environment. It instantiates and initializes
              // the components. To modify the code, only use code syntax that matches
              // what Visual Cafe can generate, or Visual Cafe may be unable to back
              // parse your Java file into its visual environment.
              //{{INIT_CONTROLS
              getContentPane().setLayout(new GridBagLayout());
              setEnabled(false);
              getContentPane().setBackground(java.awt.Color.lightGray);
              setSize(800,800);
              getContentPane().add(AdmTab, new com.symantec.itools.awt.GridBagConstraintsD(0,1,2,1,0.5,0.5,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.HORIZONTAL,new Insets(3,12,4,14),120,120));
              AdmTab.setFont(new Font("Dialog", Font.PLAIN, 12));
              titleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
              titleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
              titleLbl.setText("EAD Administration");
              getContentPane().add(titleLbl, new com.symantec.itools.awt.GridBagConstraintsD(0,0,1,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(12,36,0,0),307,15));
              titleLbl.setForeground(java.awt.Color.blue);
              titleLbl.setFont(new Font("Dialog", Font.BOLD, 15));
              exitBtn.setText("Exit EAD Administration");
              exitBtn.setActionCommand("Exit EAD Administration");
              getContentPane().add(exitBtn, new com.symantec.itools.awt.GridBagConstraintsD(0,2,2,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(6,371,10,14),66,8));
              exitBtn.setFont(new Font("Dialog", Font.PLAIN, 12));
         //theFrame.setVisible(false);
         login();
         AdmTab.addTab("Administration", new LogoPanel() );
         userPanel = createUserPanel();
         AdmTab.addTab("Edit Users", userPanel );
         fpoPanel = createFPOPanel();
         AdmTab.addTab("Edit FPO", fpoPanel );
         regulationPanel = createRegulationPanel();
         AdmTab.addTab("Edit Regulations", regulationPanel );
         rolloverPanel = createRolloverPanel();
         AdmTab.addTab("Rollover", rolloverPanel );           
              //{{REGISTER_LISTENERS
         SymMouse aSymMouse = new SymMouse();
              this.addMouseListener(aSymMouse);
              SymAction lSymAction = new SymAction();
              exitBtn.addActionListener(lSymAction);
              SymKey aSymKey = new SymKey();
              this.addKeyListener(aSymKey);
         theFrame.getContentPane().add(this);
    public class EADAdmFrame extends JFrame
    EADAdm theApplet;
    public EADAdmFrame(EADAdm theMainApplet)
              //{{INIT_CONTROLS
         //     theApplet = theMainApplet;
         //     this.getContentPane().add(theApplet);
              getContentPane().setLayout(new BorderLayout(0,0));
              getContentPane().setBackground(java.awt.Color.lightGray);
              setSize(1000,1000);
              setVisible(false);
         theApplet = theMainApplet;
              //{{REGISTER_LISTENERS
              SymWindow aSymWindow = new SymWindow();
              this.addWindowListener(aSymWindow);
              SymComponent aSymComponent = new SymComponent();
              this.addComponentListener(aSymComponent);

  • Dealing with Swing Layouts

    I have a collection of small panels with fixed size (around 50x50), and a main panel with size around 600x480.
    At run time I need to show this collection of panels on my main panel.
    Based on your experience, what would be the best layout to show them on my main panel?
    I have tried setting up a GridLayout on my main panel, but my small panels always got resized to fill my main panel, no matter how I tried to stablish the number of rows (length % rows == 0? 0 : 1 + len depending on my collection size.
    Also tried with a flowlayout, but when I added a JSCrollPanel, instead of adding new rows, my scrollpanel kept adding them on the same line :( I even enforced my scroller to
    Is this the correct behaviour? Am I doing something wrong? (I'm sure I do :))
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.util.List;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
    public class JClass extends JFrame{
        private JPanel panel;
        private JScrollPane scroll;
        protected JClass() {
            panel = new JPanel();
            scroll = new JScrollPane(panel);
            scroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER);
            JPanel menu  = new JPanel();
            JButton but  = new JButton("show");
            but.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                   display(5);
            BorderLayout layout = new BorderLayout();
            FlowLayout layout2 = new FlowLayout();
            layout2.setAlignment(FlowLayout.LEFT);
            panel.setLayout(layout2);
            menu.add(but);
            this.setPreferredSize(new Dimension(640,480));
            this.setLayout(layout);
            this.add(scroll, BorderLayout.CENTER);
            this.add(menu,BorderLayout.WEST);
            pack();       
        public void display(int n){
            JButton button;      
            for(int i = 0; i < n; i++){
                button = new JButton();
                button.setPreferredSize(new Dimension(30,30));
                this.panel.add(button);
            this.validate();
            this.repaint();     
        public static void main(String args[]) {
            JClass app = new JClass();
            app.setDefaultCloseOperation(EXIT_ON_CLOSE);
            app.setVisible(true);
    }

    Thanks Camickr.
    And just for the sake of it, do you think is there a way to do it with GridLayout? I mean, fixing the number of columns to three, but without resizing the small panels I will be adding. Maybe by fixing the preferredSize of the panel with the gridlayout to the small panels width * 3 + something?
    In my previous iteration I tried it but this content panel would always take my maximum space, thus expanding my small panels... :(

  • Swing Layout for different screen resolution

    Hi All,
    I am developing an application which will always run in a FULL SCREEN mode.
    I intend to make it working on all screen sizes (resoultions) and on different OS and devices.
    Since I am new to Swing, could anyone of you suggest a good layout manager to manage the components?
    I am using NetBeans 6.8 (which uses a GroupLayout) for designing the GUI but when I change the screen resolution, the arrangement is all messed up.
    Also, I am not able to design my application's GUI using NetBeans GUI builder as there is noway I can get an idea of how things will look like in the EXTENDED_BOTH state.
    It will be very helpful if anyone could suggest..
    Thanks!

    The entire point of Swing LayoutManagers is to get a (reasonably) consistent layout across different resolutions, window sizes, platforms, etc. Of course, different window sizes and aspect ratios will affect things slightly, but any LayoutManager properly used will do the job you're describing.
    As for which LayoutManager to use, I think that's a misleading question because it's not uncommon to use multiple LayoutManagers for a single screen. But in my experience it's possible to do 95% of what you want using GridBagLayout and a properly nested hierarchy of JPanels. GridBagLayout is a pain to get used to (caution against re-using GridBagConstraints), but once you do it's amazing what you can get out of it.

  • Swing layout + awt paintcomponent issue

    Hi guys
    I have a small issue while creating my very first application, or better, creating its GUI.
    i would like to insert in a jpanel three JTextFields on top of the panel where the user could eventually enter data, once the data are entered, a paintComponent displays the results beneath it using graphics, with simple drawLine from the paintComponent method.
    The problem is that i dont succeed to design a "good looking" panel where i can combine the organized layout of the fields and the space left for the lines of the paintcomponent method
    i can enter the fields and the lines like this:
    //contstructor definition
    add(field10);
    add(field2);
    add(field3);
    //eof constructor definition
    public void paintComponent(Graphics g){
    g.drawString("ciao"20,20);
    }but i cannot do this...
    //contructor definition
    setLayout(new GridLayout(3,2));
    add(field10);
    add(field2);
    add(field3);
    //eof constructor definition
    public void paintComponent(Graphics g){
    g.drawString("ciao"20,20);
    }because the GridLayout will occupy the whole panel and the size of the fields will be huge, so that there will be no space left for the paintComponents.
    What i would like to do is to let the GridLayout to occupy only the upper part of the JPanel so that the part below could be left to graphic content.
    I hope it sounds clear.
    Thank you
    Take care
    Edited by: classboy on Sep 8, 2009 9:28 PM

    One of the keys to understanding use of layout managers with Java is that they can be nested. More accurately, you can next Components and have each one use its own layout manager. One solution to your problem is to have a main JPanel use a BorderLayout, then add another JPanel, say called textFieldPanel that uses GridLayout and holds the three JTextFields. This panel can be added to the main panel BorderLayout.SOUTH or .NORTH, depending on your preference, and then have a third JPanel a drawingPanel that overrides paintComponent and displays the graphics, and add this to the main JPanel BorderLayout.CENTER.
    The iterations possible here are close to endless.
    Much luck.

  • Using Java swing layout

    I'm rather new at this and i'm having trouble creating my desired layout, actually i'm having trouble picking my desired layout.
    this is how i'd want my program to look...
    name place time address
    mary Hos. 12:00 70 sine st. JButton
    Kay Sch. 1:00 13 cos st. JButton
    JButton("OK")
    Hopefully you have some idea of where i'm heading. I don't want a table because i want this to be uneditable so i'm doing with with panels. the spots marked "JButton" are of course Buttons (their functions are not important). at the bottom is a single "OK" Jbutton that is aligned with the other JButtons above it.
    my issues are as follows,
    I have just 4 title labels (name, place, time, address) but there are essentially 5 components that make up the body of the list (all the others + a JButton). can anyone tell me what Layout i should use?? i've tried GridBag but i'm having trouble with the JButtons. And How in the world can i place the final OK button?

    I suppose those things were supposed to be arranged in columns? Then you want a JTable. And if you want it to be uneditable, then just make it uneditable. There's no need for enormous workarounds.

  • Designing Swing Applications - Layout

    When using JDeveloper to design a Swing application (not ADF Swing) is it possible to;
    1. when viewing the design of a frame for example, is it possible to display a grid so that you can align components correctly?
    2. when you have selected a layout from the properties editor for the panel you are working on, is it possible to display the grid lines of that layout so that you can clearly see what component/group of components are in each of the areas? Similar to when using Macromedia Dreamweaver and dragging components into a table where you can see which cell each component is currently within...
    3. add additional swing layouts to JDeveloper so that they can be used within the properties editor? i.e. tablelayout or design grid layout for example
    4. has anyone come across any guides/tutorials on using JDeveloper to design Swing based applications visually by dragging and dropping components from the palette?
    Thanks in advance for your help/advice
    David

    David - I had alot of those questions when I developed a Swing application. While I won't answer your question directly, take a look at this demo.
    http://www.oracle.com/technology/products/jdev/tips/muench/screencasts/simplejgoodies/binding_demo.html?_template=/ocom/ocom_item_templates/print
    The FormLayout as part of JGoodies managed makes the layout a lot easier - still a few things you have to get used to but it managed most of the hard stuff for your.
    Let me know if that helps
    Regards
    Grant

  • JNLP - Swing application compiled in jdk1.5 not working in jdk1.6

    I have one swing application, compiled in jdk 1.5 and deployed in JNLP with jdk 1.5. When client machine try to access the application and having jre 1.5 then it works fine. but if client machine having jre 1.6 or version greater than 1.5 then application does not work properly.
    Please help me, i got stuck and not able to solve the problem.
    this is my JNLP
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://10.1.1.145:8080/uttimesheet" href="launch.jnlp">
    <information>
    <title>TimeSheet Portal</title>
    <vendor>Geometric Global</vendor>
    <description>A simple java desktop application based on Swing Application Framework</description>
    <description kind="short">TimeSheet Portal</description>
    <homepage href="http://appframework.dev.java.net"/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+" />
    <jar href="UTTimeSheet.jar" main="true" download="eager"/>
    <jar href="lib/antlr-2.7.5H3.jar" download="eager"/>
    <jar href="lib/appframework-1.0.3.jar" download="eager"/>
    <jar href="lib/asm.jar" download="eager"/>
    <jar href="lib/cglib-2.1.jar" download="eager"/>
    <jar href="lib/commons-collections-2.1.1.jar" download="eager"/>
    <jar href="lib/commons-logging-1.0.4.jar" download="eager"/>
    <jar href="lib/dom4j-1.6.jar" download="eager"/>
    <jar href="lib/hibernate3.jar" download="eager"/>
    <jar href="lib/jta.jar" download="eager"/>
    <jar href="lib/log4j-1.2.9.jar" download="eager"/>
    <jar href="lib/poi-3.0.2.jar" download="eager"/>
    <jar href="lib/postgresql-8.3-603.jdbc3.jar" download="eager"/>
    <jar href="lib/swing-layout-1.0.3.jar" download="eager"/>
    <jar href="lib/swing-worker-1.1.jar" download="eager"/>
    <jar href="lib/swingx-0.9.2.jar" download="eager"/>
    </resources>
    <application-desc main-class="timesheetproject.TimeSheetProjectApp">
    </application-desc>
    </jnlp>
    Thanks in Advance.

    Thanks Luca for your time,
    we have deployed application in tomcat and changed the home page of tomcat to our application home page(html page). and url is http://10.1.1.145:8080/
    Application home page contain link to jnlp. so whenever user click on link (in home page) then jnlp will execute and launch the swing application.
    do you need some more clarification?
    below is the home page(html).
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Launch TimeSheet Portal via JNLP</title>
    </head>
    <body>
         <center>
              <br>
              <img src="images/Geo-logo.JPG" />          
              <br>
              <hr width="70%" />
              <br>
              <table width="70%">
                   <tr><td> </td></tr>
                   <tr>
                        <td colspan="2" align="center">
                             <align="center">
                                  <h2>Welcome to TimeSheet Portal.</h3>
                             </align>
                        </td>
                   </tr>
                   <tr><td> </td></tr>
                   <tr><td> </td></tr>
                   <tr>
                        <td align="center">
                             <align="center">
                                  <h3><u>Live Sites:</u></h3>
                             </align>
                        </td>
                        <td align="center">
                             <align="center">
                                  <h3><u>Demo Sites:</u></h3>
                             </align>
                        </td>
                   </tr>
                   <tr>
                        <td width="50%" align="center">
                             <img src="images/launchPortal.png" onmouseover="this.src='images/launchPortalMouseOver.png';" onmouseout="this.src='images/launchPortal.png';" border="0"/>          
                             <br><br>
                             <img src="images/launchAdminPortal.png" onmouseover="this.src='images/launchAdminPortalMouseOver.png';" onmouseout="this.src='images/launchAdminPortal.png';" border="0"/>          
                        </td>
                        <td width="50%" align="center">
                             <img src="images/demoPortal.png" onmouseover="this.src='images/demoPortalMouseOver.png';" onmouseout="this.src='images/demoPortal.png';" border="0"/>
                             <br><br>
                             <img src="images/demoAdminPortal.png" onmouseover="this.src='images/demoAdminPortalMouseOver.png';" onmouseout="this.src='images/demoAdminPortal.png';" border="0"/>
                        </td>
                   </tr>
                   <tr><td> </td></tr>
                   <tr><td> </td></tr>
         </table>
         <table width="70%">
              <tr><td> </td></tr>
              <tr><td> </td></tr>
              <tr><td align="center">
                   FAQ   |  
                   Help   |  
                   Why Timesheet   |  
                   Report a bug   |  
                   Contact Us   |  
    Subtask Mapping   
              </td></tr>
         </table>
         <br><br><br><br>
         <table width="70%" bgcolor="#C0C0C0" style="vertical-align: bottom">
              <tr>
                   <td colspan="2" align="center" style="vertical-align: bottom" bgcolor="#C0C0C0">
                        ©<font size="1.5" face="Verdana"> 2008 Geometric Ltd. All rights reserved.<br>
                             Best optimized for a resolution of 1024 and above. JRE 1.5 is a pre-requisite                          for using these applications.
                        </font>
                   </td>
              </tr>
         </table>
         </center>
    </body>
    </html>
    Thanks.

  • NetBeans 5.5. + layout - how can I make a jar?

    1. I try to build my application.
    2. I've developed it in NetBeans 5.5
    3. I ve used form as a base for my GUI
    4. I've made application with help of GUIBuilder+some swing components I create dynamically during program execution.
    The problem:
    I can't make runnable JAR.
    When I try to launch project.jar form folder /dist I get message:
    "No main class found"
    I need to have these jars (they are in my project's library section:
    1.swing-layout-1.0.1.jar
    2. AbsoluteLayout.jar
    I found a solution:
    How can I package the swing-layout-version.jar library
    into my application JAR?
    Having developed your Swing application in Matisse (using the "Free Design" layout) you can
    package the required swing-layout-version.jar library inside your application JAR file.
    Requirements:
    &#9679; Standard Java project
    &#9679; Swing Layout Extensions library included in your project's classpath
    Open your project's build.xml from the Files tab and insert this:
    <target name="-post-jar">
    <jar update="true" destfile="${dist.jar}">
    <zipfileset src="${libs.swing-layout.classpath}"/>
    </jar>
    </target>
    Just press F11 to build your project as usual. This Ant target will bundle swing-layout.jar
    inside your distribution JAR file.
    You can adapt this Ant target to different requirements.
    So I've inserted this code into my build.xml
    Size of built project jar file increased.
    I try to lauch it and I get no message. Nothing happens.
    What else I have to do if I want to get distributable jar....?

    So I found a problem.
    Jar with main class created using GUIBuilder (NetBeans) doesn't launch.
    I use netbeans 5.5. + jdk 1.6.
    If I launch jar with frame-based main class - everything works.
    If I try to launch form-based main class - it doesn't work.
    I do not get any error message or something like that.
    What it can be?

  • Applet does not load on app server when Free Design Layout

    Hi,
    I have to embed a an applet in a webpage of an web application. Before I go on to anything.. let me first tell you, I am using Netbeans 6.0
    As shown in the tuorial:
    [http://www.netbeans.org/kb/articles/tutorial-applets-40.html]
    1. I first made the "Applet" source say HelloApplet. java. After compiling and running it I get the HelloApplet.jar.
    2. I created a WebApplication and then from the properties -> packaging -> I "Add Project" HelloApplet.jar.
    3. Then I a webpage I "embeded" the applet.
    4. I run the web app and the applet gets loaded and everything is just fine.
    But before I go on I must tell you that the applet was designed in Null Layout. Now I edited the applet source once again and changed the layout to Free Design Layout*. ( this is available from Netbeans..on the HelloApplet.java .. go to the design view.. right click on the form and from the context menu you can change the layout to FreeDesign or whatever you might want).
    When I expand the "Libraries" node I see the that the library Swing Layout Extensions - swing-layout-1.0.3.jar has been added.
    When I "run" the "HelloApplet.java" file, the applet is shown in the appletviewer. No problems with that.
    But!
    When I try to Clean & Build and Run the WebApplication, the applet does not get loaded. On inspecting the java console I see the following error:
    java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 10 moreIt clearly shows that the Free Design Layout has something to do with the GroupLayout which can be found by expanding the "Swing Layout Extensions - swing-layout-1.0.3.jar". Now when the HelloApplet.jar is created only the HelloApplet.class file gets included together with some other data but NOT the swing extensions. Hence when I run the web app the class file looks for the GroupLayout.class definition but can find it in the jar as its not included when the HelloApplet.jar is created.
    But with null layout there isint a problem because null layout takes the definitions from the JRE on the machine.. and so it runs without a hitch.
    My Question is : How can I run the applet with Free Design Layout? or is it possible to package the swing layout extensions in the HelloApplet.jar?<</u>
    Thanks for all your replies.
    Cheers.
    Edited by: arijit_datta on May 15, 2008 4:07 PM

    Solved.
    Here is the solution:
    [http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html|http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html]
    Cheers..
    Edited by: arijit_datta on May 16, 2008 7:41 AM

  • Package org.jdesktop.layout does not exist?

    I have created a project in Netbeans using the Java Project with Existing Ant Script and am trying to use the Netbeans GUI interface to develop my project, but even though I have created a folder that contains the swing-layout-1.0.3.jar and I no longer get the errors in my java file, I cannot built the project. I get the error: package org.jdesktop.layout does not exist.
    In my java code, I can make an import statement, and Netbeans gives no errors. I can start typing "org. " and Netbeans suggests the classes, so clearly the org.jdesktop.layout does exist and is available to the code. So why am I getting this error, and how can I correct it?
    Thanks in advance,
    Chris Coulon

    i could compile it properly by givin the path to the swing-layout-1.0.3.jar file in classpath. but i'm not able to run it now. i get the following error.
    Exception in thread "main" java.lang.NoClassDefFoundError: CMSUI (wrong name: my
    /cmsui/CMSUI)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    thanks

Maybe you are looking for

  • 11.5.10.2 - Why So Many Apache Bounces

    Hello. We have been struggling for years between 11.5.9 and 11.5.10.0 and 11.5.10.1 and 11.5.10.2 to get updates to properly appear on the self-service home page after changes to functions, menus, profile options, and even added responsibilities. Wha

  • I purchased the movie The Avengers but when I try to download it to my iPad, I keep getting error messages.  What went wrong?

    I just purchased the movie The Avengers from my iPad.  It took a while to download, but then I would get a error message that download isn't complete and to retry.  I'd retry and the same message would pop up again.  What went wrong? Thanks.

  • Agent Determination Rule using Function Module

    Hi all, I am trying to create a custom agent determination rule using function module. But my rule is not getting invoked when the workflow is executed. I created a custom rule and linked my function module (with proper signature). FUNCTION 'ZRULEXXX

  • Is axis ptz 215 ip camera compatible with labview?

    Hi I am working with labview for my final year project and am trying to find a ip camera which will work in labview. I wish to use the axis 215 ptz but want to make 100% sure that I will be able to capture video input from it before I purchase it. so

  • OCI version 10.1.0.2.0 is not supported in Toad

    I have upgraded my 9203 Oracle database to 10.1.0.2. Now when I connect to the database via TOAD 7.6, it gives me the following error: "OCI version 10.1.0.2.0 is not supported" Can some one let me know about how to solve this problem. Thanks in Advan