c.fill = GridBagConstraints.VERTICAL;  c.weightx = 1; c.weighty = 1; origin.add(new JLabel("Width: "), c);
c.fill = GridBagConstraints.BOTH; c.weighty = 1; c.insets = new Insets(5, 0, 0, 0); newSizePanel.add(new JLabel("Width: "), c);
    private void init() {        bOk = new JButton("OK");        bCancel = new JButton("Cancel");        /* SIZING PANEL */        JPanel sizing = new JPanel();        JPanel outerSizing = new JPanel();        width = new JTextField("" + currentMap.getWidth(), 5);        height = new JTextField("" + currentMap.getHeight(), 5);        offsetX = new JTextField("0", 5);        offsetY = new JTextField("0", 5);        outerSizing.setBorder(BorderFactory.createCompoundBorder(                    BorderFactory.createTitledBorder("New size"),                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));        outerSizing.setLayout(new BoxLayout(outerSizing, BoxLayout.PAGE_AXIS));        sizing.setLayout(new GridBagLayout());        GridBagConstraints c = new GridBagConstraints();        c.anchor = GridBagConstraints.WEST;        c.fill = GridBagConstraints.VERTICAL;        //c.insets = new Insets(5, 0, 0, 0);        c.weightx = 1;        c.weighty = 1;        sizing.add(new JLabel("Width: "), c);        c.gridy = 1;        sizing.add(new JLabel("Height: "), c);        c.gridx = 1; c.gridy = 0;        c.weightx = 3;        sizing.add(width, c);        c.gridy = 1;        sizing.add(height, c);        c.gridx = 0; c.gridy = 3;        sizing.add(new JLabel("X: "), c);        c.gridy = 4;        sizing.add(new JLabel("Y: "), c);        c.gridx = 1; c.gridy = 3;        c.weightx = 3;        sizing.add(offsetX, c);        c.gridy = 4;        sizing.add(offsetY, c);        c.gridx = 0; c.gridy = 5;        /* ORIENTATION PANEL */        ResizePanel orient = new ResizePanel(new Dimension(100,100),100);        outerSizing.add(sizing);        outerSizing.add(Box.createRigidArea(new Dimension(0,5)));        outerSizing.add(orient);        /* ORIGINAL SIZE PANEL */        JPanel origin = new VerticalStaticJPanel();        origin.setBorder(BorderFactory.createCompoundBorder(                    BorderFactory.createTitledBorder("Original size"),                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));        origin.setLayout(new GridBagLayout());        c = new GridBagConstraints();        c.anchor = GridBagConstraints.WEST;        c.fill = GridBagConstraints.VERTICAL;        //c.insets = new Insets(5, 0, 0, 0);        c.weightx = 1;        c.weighty = 1;        origin.add(new JLabel("Width: "), c);        c.gridy = 1;        origin.add(new JLabel("Height: "), c);        c.gridx = 1; c.gridy = 0;        c.weightx = 3;        origin.add(new JLabel("" + currentMap.getWidth()), c);        c.gridy = 1;        origin.add(new JLabel("" + currentMap.getHeight()), c);        /* BUTTONS PANEL */        bOk.addActionListener(this);        bCancel.addActionListener(this);        JPanel buttons = new VerticalStaticJPanel();        buttons.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));        buttons.add(Box.createGlue());        buttons.add(bOk);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bCancel);        JPanel mainPanel = new JPanel();        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));        mainPanel.add(origin);        mainPanel.add(outerSizing);        //mainPanel.add(orient);        mainPanel.add(Box.createRigidArea(new Dimension(0, 5)));        mainPanel.add(buttons);        getContentPane().add(mainPanel);        getRootPane().setDefaultButton(bOk);        pack();    }