JScrollPane miniMapSp = new JScrollPane(); miniMapSp.getViewport().setView(miniMap);*/
    private void createData() {        JButton b;        JToolBar tabsPanel = new JToolBar();        JTabbedPane paintPanel = new JTabbedPane();                dataPanel = new JPanel(new BorderLayout());        // Try to load the icons        Icon imgAdd = loadIcon("resources/gnome-new.png");        Icon imgDel = loadIcon("resources/gnome-delete.png");        Icon imgDup = loadIcon("resources/gimp-duplicate-16.png");        Icon imgUp = loadIcon("resources/gnome-up.png");        Icon imgDown = loadIcon("resources/gnome-down.png");        //navigation and tool options        miniMap = new MiniMapViewer();        miniMap.setMainPanel(mapScrollPane);        // Layer table        layerTable = new JTable(new LayerTableModel(currentMap));        layerTable.getColumnModel().getColumn(0).setPreferredWidth(32);        layerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        layerTable.getSelectionModel().addListSelectionListener(this);        // Opacity slider        opacitySlider = new JSlider(0, 100, 100);        opacitySlider.addChangeListener(this);        JLabel opacityLabel = new JLabel("Opacity: ");        opacityLabel.setLabelFor(opacitySlider);        JPanel sliderPanel = new JPanel();        sliderPanel.setLayout(new BoxLayout(sliderPanel, BoxLayout.X_AXIS));        sliderPanel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));        sliderPanel.add(opacityLabel);        sliderPanel.add(opacitySlider);        sliderPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE,                    sliderPanel.getPreferredSize().height));        // Layer buttons        layerAddButton = createButton(imgAdd, "Add Layer", "Add Layer");        layerDelButton = createButton(imgDel, "Delete Layer", "Delete Layer");        layerCloneButton = createButton(imgDup, "Duplicate Layer",                "Duplicate Layer");        layerUpButton = createButton(imgUp, "Move Layer Up", "Move Layer Up");        layerDownButton = createButton(imgDown, "Move Layer Down",                "Move Layer Down");        mapEventAdapter.addListener(layerAddButton);        JPanel layerButtons = new JPanel();        layerButtons.setLayout(new GridBagLayout());        GridBagConstraints c = new GridBagConstraints();        c.fill = GridBagConstraints.BOTH;        c.weightx = 1;        layerButtons.add(layerAddButton, c);        layerButtons.add(layerUpButton, c);        layerButtons.add(layerDownButton, c);        layerButtons.add(layerCloneButton, c);        layerButtons.add(layerDelButton, c);        layerButtons.setMaximumSize(new Dimension(Integer.MAX_VALUE,                    layerButtons.getPreferredSize().height));        // Edit history        /*JScrollPane editSp = new JScrollPane();        editHistoryList = new JList();        editSp.setHorizontalScrollBarPolicy(                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);        editSp.getViewport().setView(editHistoryList);*/        JPanel layerPanel = new JPanel();        layerPanel.setLayout(new GridBagLayout());        layerPanel.setPreferredSize(new Dimension(120, 120));        c = new GridBagConstraints();        c.insets = new Insets(3, 0, 0, 0); c.weightx = 1; c.weighty = 0;        c.fill = GridBagConstraints.BOTH;        c.gridx = 0; c.gridy = 0;        c.weighty = 1;        layerPanel.add(miniMap);        c.weighty = 0; c.gridy += 1;        layerPanel.add(sliderPanel, c);        c.weighty = 1; c.gridy += 1;        layerPanel.add(new JScrollPane(layerTable), c);        c.weighty = 0; c.insets = new Insets(0, 0, 0, 0); c.gridy += 1;        layerPanel.add(layerButtons, c);        /*c.weighty = 0.25; c.insets = new Insets(3, 0, 0, 0); c.gridy += 1;        layerPanel.add(editSp, c);*/        // Create paint panel        tilePalettePanel = new TilePalettePanel();        JPanel brushesPanel = new JPanel();        paintPanel.add("Palette", tilePalettePanel);        paintPanel.add("Brushes", brushesPanel);        paintPanel.setSelectedIndex(1);        tabsPanel.add(paintPanel);        dataPanel.add(layerPanel);    }