tileList.addMouseListener(this);
tileList.addListSelectionListener(this);
    private void init() {        // Create the buttons        bOk = new JButton("OK");        bDelete = new JButton("Delete Tile");        bChangeI = new JButton("Change Image");        bDuplicate = new JButton("Duplicate Tile");        bNew = new JButton("Add Tile");        bOk.addActionListener(this);        bDelete.addActionListener(this);        bChangeI.addActionListener(this);        bDuplicate.addActionListener(this);        bNew.addActionListener(this);        tileList = new JList();        // Tile properties table        tileProperties = new JTable(new PropertiesTableModel());        tileProperties.getSelectionModel().addListSelectionListener(this);        JScrollPane propScrollPane = new JScrollPane(tileProperties);        propScrollPane.setPreferredSize(new Dimension(150, 150));        // Tile list        tileList.addMouseListener(this);        JScrollPane sp = new JScrollPane();        sp.getViewport().setView(tileList);        // The split pane        JSplitPane splitPane = new JSplitPane(                JSplitPane.HORIZONTAL_SPLIT, true);        splitPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));        splitPane.setResizeWeight(0.25);        splitPane.setLeftComponent(sp);        splitPane.setRightComponent(propScrollPane);        // The buttons        JPanel buttons = new VerticalStaticJPanel();        buttons.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));        buttons.add(bNew);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bDelete);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bChangeI);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(bDuplicate);        buttons.add(Box.createRigidArea(new Dimension(5, 0)));        buttons.add(Box.createGlue());        buttons.add(bOk);        // Putting it all together        JPanel mainPanel = new JPanel();        mainPanel.setLayout(new GridBagLayout());        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));        GridBagConstraints c = new GridBagConstraints();        c.fill = GridBagConstraints.BOTH;        c.weightx = 1; c.weighty = 1;        mainPanel.add(splitPane, c);        c.weightx = 0; c.weighty = 0; c.gridy = 1;        mainPanel.add(buttons, c);        getContentPane().add(mainPanel);        getRootPane().setDefaultButton(bOk);    }