@@ -0,0 +1,1930 @@
+package com.dw.swing;%0A%0Aimport java.awt.Container;%0Aimport java.awt.Insets;%0Aimport java.awt.Dimension;%0Aimport javax.swing.JButton;%0Aimport javax.swing.JFrame;%0A%0Apublic class AbsoluteLayoutDemo %7B%0A%09%0A%09 public static void addComponentsToPane(Container pane) %7B%0A%09        pane.setLayout(null);%0A%09 %0A%09        JButton b1 = new JButton(%22one%22);%0A%09        JButton b2 = new JButton(%22two%22);%0A%09        JButton b3 = new JButton(%22three%22);%0A%09 %0A%09        pane.add(b1);%0A%09        pane.add(b2);%0A%09        pane.add(b3);%0A%09 %0A%09        Insets insets = pane.getInsets();%0A%09        Dimension size = b1.getPreferredSize();%0A%09        b1.setBounds(25 + insets.left, 5 + insets.top,%0A%09                     size.width, size.height);%0A%09        size = b2.getPreferredSize();%0A%09        b2.setBounds(55 + insets.left, 40 + insets.top,%0A%09                     size.width, size.height);%0A%09        size = b3.getPreferredSize();%0A%09        b3.setBounds(150 + insets.left, 15 + insets.top,%0A%09                     size.width + 50, size.height + 20);%0A%09    %7D%0A%09 %0A%09    /**%0A%09     * Create the GUI and show it.  For thread safety,%0A%09     * this method should be invoked from the%0A%09     * event-dispatching thread.%0A%09     */%0A%09    private static void createAndShowGUI() %7B%0A%09        //Create and set up the window.%0A%09        JFrame frame = new JFrame(%22AbsoluteLayoutDemo%22);%0A%09        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A%09 %0A%09        //Set up the content pane.%0A%09        addComponentsToPane(frame.getContentPane());%0A%09 %0A%09        //Size and display the window.%0A%09        Insets insets = frame.getInsets();%0A%09        frame.setSize(300 + insets.left + insets.right,%0A%09                      125 + insets.top + insets.bottom);%0A%09        frame.setVisible(true);%0A%09    %7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09javax.swing.SwingUtilities.invokeLater(new Runnable() %7B%0A            public void run() %7B%0A                createAndShowGUI();%0A            %7D%0A        %7D);%0A%09%7D%0A%0A%7D%0A

add absoluteLayout demo