Example usage for java.awt BorderLayout PAGE_START

List of usage examples for java.awt BorderLayout PAGE_START

Introduction

In this page you can find the example usage for java.awt BorderLayout PAGE_START.

Prototype

String PAGE_START

To view the source code for java.awt BorderLayout PAGE_START.

Click Source Link

Document

The component comes before the first line of the layout's content.

Usage

From source file:net.sf.maltcms.common.charts.ui.CategoryChartTopComponent.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*  ww w  . j a v a  2  s  .co  m*/
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jToolBar1 = new javax.swing.JToolBar();
    clearSelection = new javax.swing.JButton();

    setLayout(new java.awt.BorderLayout());

    jToolBar1.setRollover(true);

    org.openide.awt.Mnemonics.setLocalizedText(clearSelection, org.openide.util.NbBundle
            .getMessage(CategoryChartTopComponent.class, "CategoryChartTopComponent.clearSelection.text")); // NOI18N
    clearSelection.setFocusable(false);
    clearSelection.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    clearSelection.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    clearSelection.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearSelectionActionPerformed(evt);
        }
    });
    jToolBar1.add(clearSelection);

    add(jToolBar1, java.awt.BorderLayout.PAGE_START);
}

From source file:com.microsoft.alm.plugin.idea.ui.common.tabs.TabFormImpl.java

/**
 * Create the tab view if not already done
 *//*from   ww w. j  a va 2  s .  c om*/
protected void ensureInitialized() {
    if (!initialized) {
        createCustomView();
        createFilterToolbar();

        //toolbars
        final JPanel toolBarPanel;
        if (ApplicationManager.getApplication() != null) {
            final ActionToolbar prActionsToolbar = createToolbar(createActionsGroup());
            final ActionToolbar feedbackActionsToolbar = createToolbar(createFeedbackGroup());

            // left panel of the top toolbar
            final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding
            final JPanel toolBarPanelLeft = new JPanel(flowLayout);
            toolBarPanelLeft.add(prActionsToolbar.getComponent());
            toolBarPanelLeft.add(searchFilter);

            //entire top toolbar
            toolBarPanel = new JPanel(new BorderLayout());
            toolBarPanel.add(toolBarPanelLeft, BorderLayout.LINE_START);
            toolBarPanel.add(feedbackActionsToolbar.getComponent(), BorderLayout.LINE_END);
        } else {
            //skip setup when called from unit tests
            toolBarPanel = new JPanel();
        }

        //status panel with label and link
        final JPanel statusPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        statusLabel = new JLabel();
        statusLink = new Hyperlink();
        statusLink.setActionCommand(CMD_STATUS_LINK);
        statusPanel.add(statusLabel);
        statusPanel.add(statusLink);

        //tabPanel
        tabPanel = new JPanel(new BorderLayout());
        tabPanel.add(toolBarPanel, BorderLayout.PAGE_START);
        tabPanel.add(scrollPanel, BorderLayout.CENTER);
        tabPanel.add(statusPanel, BorderLayout.PAGE_END);
        this.initialized = true;
    }
}

From source file:misc.ActionDemo.java

public void createToolBar() {
    JButton button = null;//  w  ww  . ja va  2 s  .  c o  m

    //Create the toolbar.
    JToolBar toolBar = new JToolBar();
    add(toolBar, BorderLayout.PAGE_START);

    //first button
    button = new JButton(leftAction);
    if (button.getIcon() != null) {
        button.setText(""); //an icon-only button
    }
    toolBar.add(button);

    //second button
    button = new JButton(middleAction);
    if (button.getIcon() != null) {
        button.setText(""); //an icon-only button
    }
    toolBar.add(button);

    //third button
    button = new JButton(rightAction);
    if (button.getIcon() != null) {
        button.setText(""); //an icon-only button
    }
    toolBar.add(button);
}

From source file:events.TableListSelectionDemo.java

public TableListSelectionDemo() {
    super(new BorderLayout());

    String[] columnNames = { "French", "Spanish", "Italian" };
    String[][] tableData = { { "un", "uno", "uno" }, { "deux", "dos", "due" }, { "trois", "tres", "tre" },
            { "quatre", "cuatro", "quattro" }, { "cinq", "cinco", "cinque" }, { "six", "seis", "sei" },
            { "sept", "siete", "sette" } };

    table = new JTable(tableData, columnNames);
    listSelectionModel = table.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    table.setSelectionModel(listSelectionModel);
    JScrollPane tablePane = new JScrollPane(table);

    //Build control area (use default FlowLayout).
    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);/*from   w  w  w .j a  v  a2s . c o m*/
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    //Build output area.
    output = new JTextArea(1, 10);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    //Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.LINE_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    JPanel tableContainer = new JPanel(new GridLayout(1, 1));
    tableContainer.setBorder(BorderFactory.createTitledBorder("Table"));
    tableContainer.add(tablePane);
    tablePane.setPreferredSize(new Dimension(420, 130));
    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(250, 50));
    topHalf.setPreferredSize(new Dimension(200, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.PAGE_START);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    //XXX: next line needed if bottomHalf is a scroll pane:
    //bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 110));
    splitPane.add(bottomHalf);
}

From source file:ListSelectionDemo.java

public ListSelectionDemo() {
    super(new BorderLayout());

    String[] listData = { "one", "two", "three", "four", "five", "six", "seven" };
    String[] columnNames = { "French", "Spanish", "Italian" };
    list = new JList(listData);

    listSelectionModel = list.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    JScrollPane listPane = new JScrollPane(list);

    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);/*w ww. j a va2s.c om*/
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    // Build output area.
    output = new JTextArea(1, 10);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    // Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.LINE_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    listContainer.setBorder(BorderFactory.createTitledBorder("List"));
    listContainer.add(listPane);

    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    // topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(100, 50));
    topHalf.setPreferredSize(new Dimension(100, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.PAGE_START);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    // XXX: next line needed if bottomHalf is a scroll pane:
    // bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 135));
    splitPane.add(bottomHalf);
}

From source file:eu.cassandra.csn.gui.CSN.java

/**
 * /*from ww w  . ja  v a2 s.c  om*/
 * @param graph
 * @return
 */
public static JPanel setUpView() {
    JPanel csnPanel = new JPanel();
    vv.getGraphLayout().setSize(new Dimension(csnPanel.getWidth(), csnPanel.getHeight()));
    setUpVV();
    GraphZoomScrollPane graphZoomScrollPane = new GraphZoomScrollPane(vv);
    JPanel thisPanel = new JPanel(new BorderLayout());
    thisPanel.add(graphZoomScrollPane, BorderLayout.CENTER);

    slider.setBackground(Color.WHITE);
    slider.setPreferredSize(new Dimension(210, 50));
    slider.setPaintTicks(true);
    slider.setMaximum(100);
    slider.setMinimum(0);
    slider.setValue(0);
    slider.setMajorTickSpacing(50);
    slider.setPaintLabels(true);
    slider.setPaintTicks(true);
    slider.setBorder(BorderFactory.createLineBorder(Color.black));
    slider.setEnabled(false);
    sliderLabel.setEnabled(false);
    slider.addMouseListener(new MouseListener() {
        @Override
        public void mouseReleased(MouseEvent e) {
            if (sliderLabel.getText().contains("oltage"))
                ClusterGraph.clusterAndRecolor(ClusterGraph.VoltageClusterer, slider.getValue());
            else if (sliderLabel.getText().contains("etweenness"))
                ClusterGraph.clusterAndRecolor(ClusterGraph.BetweennessClusterer, slider.getValue());
        }

        public void mouseClicked(MouseEvent arg0) {
        }

        public void mouseEntered(MouseEvent arg0) {
        }

        public void mouseExited(MouseEvent arg0) {
        }

        public void mousePressed(MouseEvent arg0) {
        }
    });
    JPanel p = new JPanel(new BorderLayout());
    p.add(sliderLabel, BorderLayout.PAGE_START);
    p.add(slider, BorderLayout.CENTER);

    sliderEdge.setBackground(Color.WHITE);
    sliderEdge.setPreferredSize(new Dimension(210, 50));
    sliderEdge.setPaintTicks(true);
    sliderEdge.setValue(0);
    sliderEdge.setMajorTickSpacing(5);
    sliderEdge.setPaintLabels(true);
    sliderEdge.setPaintTicks(true);
    sliderEdge.setBorder(BorderFactory.createLineBorder(Color.black));
    sliderEdge.setEnabled(false);
    sliderLabelEdge.setEnabled(false);
    sliderEdge.addMouseListener(new MouseListener() {
        @Override
        public void mouseReleased(MouseEvent e) {
            double v = Double
                    .parseDouble(((JLabel) sliderEdge.getLabelTable().get(sliderEdge.getValue())).getText());
            CSNGraph.addEdgesBasedOnKL(v);
        }

        public void mouseClicked(MouseEvent arg0) {
        }

        public void mouseEntered(MouseEvent arg0) {
        }

        public void mouseExited(MouseEvent arg0) {
        }

        public void mousePressed(MouseEvent arg0) {
        }
    });
    JPanel pEdge = new JPanel(new BorderLayout());
    pEdge.add(sliderLabelEdge, BorderLayout.PAGE_START);
    pEdge.add(sliderEdge, BorderLayout.CENTER);

    JPanel p2 = new JPanel(new BorderLayout());
    p2.add(pEdge, BorderLayout.PAGE_START);
    p2.add(p, BorderLayout.PAGE_END);

    thisPanel.add(p2, BorderLayout.PAGE_END);

    return thisPanel;
}

From source file:ui.panel.UIBucketSelect.java

public void runBucketSelect() {
    Panel p = new Panel();
    Button b = new Button();
    Label l = new Label();

    setLayout(new BorderLayout());

    JPanel pnlInstruction = p.createPanel(Layouts.flow);
    JLabel lblInstruction = l.createLabel("Bucket List");
    pnlInstruction.setBackground(CustomColor.LightBlue.returnColor());
    lblInstruction.setForeground(Color.white);
    lblInstruction.setFont(new Font("San Serif", Font.PLAIN, 18));
    pnlInstruction.add(lblInstruction);//from  w  ww . ja va 2 s . co m

    JPanel pnlBucketList = p.createPanel(Layouts.border);

    listBucket.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JScrollPane scrollBucket = new JScrollPane(listBucket);
    scrollBucket.setPreferredSize(new Dimension(300, 150));
    pnlBucketList.add(scrollBucket, BorderLayout.CENTER);

    JPanel pnlButtons = p.createPanel(Layouts.flow);
    JButton btnBack = b.createButton("Back");
    JButton btnSelectElements = b.createButton("Next");
    JButton btnRefresh = b.createButton("Refresh Bucket List");

    pnlButtons.add(btnBack);
    pnlButtons.add(btnRefresh);
    pnlButtons.add(btnSelectElements);

    add(pnlInstruction, BorderLayout.NORTH);
    add(pnlBucketList, BorderLayout.CENTER);
    add(pnlButtons, BorderLayout.SOUTH);
    setVisible(true);

    btnRefresh.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            getBucketData();
        }
    });
    btnSelectElements.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SwingWorker<Void, Void> mySwingWorker = new SwingWorker<Void, Void>() {
                @Override
                protected Void doInBackground() throws Exception {

                    int selected = listBucket.getSelectedRow();
                    if (selected == -1) {
                        JOptionPane.showMessageDialog(Data.mainFrame, "Please Select a Bucket", "Error",
                                JOptionPane.ERROR_MESSAGE);
                    } else {
                        Data.bucketID = (int) listBucket.getModel().getValueAt(selected, 0);
                        Data.mainFrame.addPanel(Data.mainFrame.uiLicenseDetail = new UILicenseDetail(),
                                "license");
                        Data.mainFrame.pack();
                        Data.mainFrame.showPanel("license");
                    }
                    return null;
                }
            };

            Window win = SwingUtilities.getWindowAncestor((AbstractButton) e.getSource());
            final JDialog dialog = new JDialog(win, "Loading", ModalityType.APPLICATION_MODAL);

            mySwingWorker.addPropertyChangeListener(new PropertyChangeListener() {

                @Override
                public void propertyChange(PropertyChangeEvent evt) {
                    if (evt.getPropertyName().equals("state")) {
                        if (evt.getNewValue() == SwingWorker.StateValue.DONE) {
                            dialog.dispose();
                        }
                    }
                }
            });
            mySwingWorker.execute();

            JProgressBar progressBar = new JProgressBar();
            progressBar.setIndeterminate(true);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(progressBar, BorderLayout.CENTER);
            panel.add(new JLabel("Retrieving Licenses......."), BorderLayout.PAGE_START);
            dialog.add(panel);
            dialog.pack();
            dialog.setBounds(50, 50, 300, 100);
            dialog.setLocationRelativeTo(Data.mainFrame);
            dialog.setVisible(true);
        }
    });
    btnBack.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            Data.mainFrame.showPanel("inventory");
        }
    });
}

From source file:nl.tudelft.goal.SimpleIDE.SimpleIDE.java

/**
 * Creates the IDE interface and related services.
 *//*from  w ww  .  j  a va 2 s  . c o m*/
public SimpleIDE() throws InstantiationException, IllegalAccessException {
    // Do not use InfoLog; nothing is subscribed yet.
    System.out.println("Launching IDE"); //$NON-NLS-1$

    /**
     * Checks whether logs should be rerouted to console as well. Set to
     * false by default. Only to be used for debugging purposes by
     * developers; change via settings file.
     */
    if (LoggingPreferences.getShowLogsInConsole()) {
        Loggers.addConsoleLogger();
    }

    // Initialize the action factory.
    ActionFactory.getFactory(this, new IDETempState());

    // Set look and feel.
    setLookAndFeel();

    /**
     * Set size first, otherwise it is not clear how the fractional values
     * e.g. for setDividerLocation work out.
     */
    setSize(IDEPreferences.getWinWidth(), IDEPreferences.getWinHeight());
    if (IDEPreferences.getRememberWinPos()) {
        setLocation(IDEPreferences.getWinX(), IDEPreferences.getWinY());
    }
    setTitle("GOAL IDE"); //$NON-NLS-1$

    setLayout(new BorderLayout());

    // Add center panel; do this before adding tool bar which depends on it
    // for initialization of buttons.
    this.mainPanel = new IDEMainPanel(this);
    add(this.mainPanel, BorderLayout.CENTER);
    this.statusBar = new StatusBar();
    add(this.statusBar, BorderLayout.SOUTH);

    // Add menu.
    setJMenuBar(new IDEMenuBar());

    // Add tool bar.
    add(new ToolBar(), BorderLayout.PAGE_START);
    setVisible(true);

    if (System.getProperty("os.name").equals("Mac OS X")) { //$NON-NLS-1$ //$NON-NLS-2$
        OSXAdapter.setQuitHandler(new Runnable() {
            @Override
            public void run() {
                try {
                    ActionFactory.getAction(QuitAction.class).Execute(null, null);
                } catch (IllegalAccessException | InstantiationException | GOALException e) {
                    e.printStackTrace();
                }
            }
        });
    }

    // Disable default close operation and install quit "button" handler.
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            try {
                ActionFactory.getAction(QuitAction.class).Execute(null, null);
            } catch (Exception er) {
                System.out.println("BUG: QUIT FAILED"); //$NON-NLS-1$
                er.printStackTrace();
            }
        }
    });
    addComponentListener(new ComponentAdapter() {
        @Override
        public void componentMoved(ComponentEvent e) {
            IDEPreferences.setLastWinPos(getLocation());
        }

        @Override
        public void componentResized(ComponentEvent e) {
            IDEPreferences.setLastWinSize(getSize());
        }
    });

    // Set initial content of file panel.
    // TODO move application logic to platform manager.
    if (IDEPreferences.getReopenMASs()) {
        reopenMASs();
    }
    if (IDEPreferences.getReopenSpurious()) {
        reopenSpurious();
    }

    // IDE state has been configured. Broadcast the info.
    ActionFactory.broadcastStateChange(this);
}

From source file:TableSelectionDemo.java

public TableSelectionDemo() {
    super(new BorderLayout());

    String[] columnNames = { "French", "Spanish", "Italian" };
    String[][] tableData = { { "un", "uno", "uno" }, { "deux", "dos", "due" }, { "trois", "tres", "tre" },
            { "quatre", "cuatro", "quattro" }, { "cinq", "cinco", "cinque" }, { "six", "seis", "sei" },
            { "sept", "siete", "sette" } };

    table = new JTable(tableData, columnNames);
    listSelectionModel = table.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    table.setSelectionModel(listSelectionModel);
    JScrollPane tablePane = new JScrollPane(table);

    // Build control area (use default FlowLayout).
    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);//  w ww .ja  v a 2s. com
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    // Build output area.
    output = new JTextArea(1, 10);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    // Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.LINE_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    JPanel tableContainer = new JPanel(new GridLayout(1, 1));
    tableContainer.setBorder(BorderFactory.createTitledBorder("Table"));
    tableContainer.add(tablePane);
    tablePane.setPreferredSize(new Dimension(420, 130));
    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(250, 50));
    topHalf.setPreferredSize(new Dimension(200, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.PAGE_START);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    // XXX: next line needed if bottomHalf is a scroll pane:
    // bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 110));
    splitPane.add(bottomHalf);
}

From source file:net.sf.maltcms.common.charts.ui.XYChartTopComponent.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from w  w w .  ja  va2 s.  co m
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jToolBar1 = new javax.swing.JToolBar();
    jComboBox1 = new javax.swing.JComboBox();
    clearSelection = new javax.swing.JButton();

    setLayout(new java.awt.BorderLayout());

    jToolBar1.setRollover(true);

    jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(
            new String[] { "Line And Shape", "Line", "Shape", "Area w/ Shapes", "Area" }));
    jComboBox1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBox1ActionPerformed(evt);
        }
    });
    jToolBar1.add(jComboBox1);

    org.openide.awt.Mnemonics.setLocalizedText(clearSelection, org.openide.util.NbBundle
            .getMessage(XYChartTopComponent.class, "XYChartTopComponent.clearSelection.text")); // NOI18N
    clearSelection.setFocusable(false);
    clearSelection.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    clearSelection.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    clearSelection.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearSelectionActionPerformed(evt);
        }
    });
    jToolBar1.add(clearSelection);

    add(jToolBar1, java.awt.BorderLayout.PAGE_START);
}