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:view.ResultsPanel.java

public void displayFrame(final List<ElementaryMode> modes, final List<Integer> indices) {

    this.removeAll();

    DefaultTableModel model = (DefaultTableModel) modeTable.getModel();

    while (model.getRowCount() > 0) {
        model.removeRow(0);//from  w w w . j a v  a 2  s. com
    }

    if (modes.size() > 0) {
        setTable(0, modes);
    }
    JLabel nbMod = new JLabel(modes.size() + " mode(s) found");

    toolbar = new JToolBar();
    // set elements in the toolbar
    toolbar.setLayout(new BoxLayout(toolbar, BoxLayout.LINE_AXIS));
    toolbar.add(nbMod);
    toolbar.setFloatable(false);

    Object[] comboElements = new Object[modes.size()];

    for (int i = 0; i < modes.size(); i++) {

        comboElements[i] = "mode " + indices.get(i);
    }

    modesCombo = new JComboBox(comboElements);

    if (modesCombo.getActionListeners().length > 0) {
        modesCombo.removeActionListener(modesCombo.getActionListeners()[0]);
    }
    modesCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setTable(modesCombo.getSelectedIndex(), modes);
        }
    });

    if (modes.size() > 0) {
        toolbar.add(modesCombo);
    }
    modesCombo.setMaximumSize(new Dimension(100, 30));

    //we put the right size for le comboBox
    int sizeMax = String.valueOf(modes.size()).length();

    String stringMax = "mode ";
    for (int i = 0; i < sizeMax; i++) {
        stringMax += "X";
    }

    modesCombo.setPrototypeDisplayValue(stringMax);

    if (download.getActionListeners().length > 0) {
        download.removeActionListener(download.getActionListeners()[0]);
    }
    download.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            Thread thread = new DownloadContentThread(modes, controler, command, log.getText());
            thread.start();

        }
    });

    if (histoButton.getActionListeners().length > 0) {
        histoButton.removeActionListener(histoButton.getActionListeners()[0]);
    }
    histoButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            showHistogram(modes);

        }

    });

    toolbar.add(histoButton);
    toolbar.add(filterButton);
    toolbar.add(download);
    toolbar.add(scriptButton);
    if (!isAttached) {
        toolbar.add(addToProject);
    } else {
        toolbar.add(removeFromProject);
    }

    toolbar.add(Box.createHorizontalGlue());
    toolbar.add(searchField);
    toolbar.add(new JLabel(Var.iconsearch));

    JPanel logPanel = new JPanel(new BorderLayout());

    logPanel.add(new JLabel("Generetad log", JLabel.CENTER), BorderLayout.PAGE_START);
    logPanel.add(new JScrollPane(log), BorderLayout.CENTER);

    this.setLayout(new BorderLayout());

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(modeTable), logPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(500);

    add(toolbar, BorderLayout.PAGE_START);
    this.add(splitPane, BorderLayout.CENTER);

    this.revalidate();
    this.repaint();
}

From source file:be.ac.ua.comp.scarletnebula.gui.windows.GUI.java

private void addToolbar() {
    final JToolBar toolbar = new JToolBar();

    final Icon addIcon = Utils.icon("add16.png");

    final JButton addButton = new JButton(addIcon);
    addButton.addActionListener(new ActionListener() {
        @Override// w  w  w.  ja  v  a  2 s  . c  o m
        public void actionPerformed(final ActionEvent e) {
            startAddServerWizard();
        }
    });
    addButton.setBounds(10, 10, addIcon.getIconWidth(), addIcon.getIconHeight());

    final Icon refreshIcon = Utils.icon("refresh16.png");
    final JButton refreshButton = new JButton(refreshIcon);
    refreshButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            refreshSelectedServers();
        }
    });
    refreshButton.setBounds(10, 10, refreshIcon.getIconWidth(), refreshIcon.getIconHeight());

    final Icon searchIcon = Utils.icon("search16.png");
    final JButton searchButton = new JButton(searchIcon);
    searchButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            showFilter();
        }
    });
    searchButton.setBounds(10, 10, searchIcon.getIconWidth(), searchIcon.getIconHeight());

    toolbar.add(addButton);
    toolbar.add(refreshButton);
    toolbar.add(searchButton);
    toolbar.setFloatable(false);
    add(toolbar, BorderLayout.PAGE_START);
}

From source file:com.projity.reports.view.ReportView.java

public void init(CoordinatesConverter coord) {
    initializing = true;//w  w  w . ja  v a2 s . c om
    this.coord = coord;
    setLayout(layout);
    reportLabel = new JLabel(Messages.getString("ReportView.Report")); //$NON-NLS-1$
    reportChoice = new JComboBox(ReportUtil.getReportDefinitions());
    reportChoice.setSelectedIndex(0);
    reportDefinition = (ReportDefinition) reportChoice.getSelectedItem();
    fieldArray = reportDefinition.getMainFieldArray();
    reportChoice.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent arg0) {
            reportDefinition = (ReportDefinition) ((JComboBox) arg0.getSource()).getSelectedItem();
            fieldArray = reportDefinition.getMainFieldArray();
            dirty = true;
            showReport();
            initColumns();
        }
    });

    columnsLabel = new JLabel(Messages.getString("ReportView.Columns")); //$NON-NLS-1$
    columnsChoice = new JComboBox();
    initColumns();
    columnsChoice.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent arg0) {
            fieldArray = (SpreadSheetFieldArray) ((JComboBox) arg0.getSource()).getSelectedItem();
            dirty = true;
            showReport();
        }
    });
    add(header(), BorderLayout.PAGE_START);
    showReport();
    initializing = false;
}

From source file:org.rivalry.swingui.RivalryUI.java

/**
 * @return a new tool bar panel.// ww  w .  j  a v  a 2s  .  c om
 */
private JPanel createToolBarPanel() {
    final JPanel answer = new JPanel(new BorderLayout());

    answer.add(createToolBar(), BorderLayout.PAGE_START);

    return answer;
}

From source file:giaodien.tongquan.TongQuan.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  www  .j a  v a 2s  .  c  o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    Toppanel = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    tfDoanhSo = new javax.swing.JTextField();
    tfHoaDon = new javax.swing.JTextField();
    hinhdoanhthu = new javax.swing.JLabel();
    hinhhoadon = new javax.swing.JLabel();
    List = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList<>();
    Detailpanel = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    jcbThang = new javax.swing.JComboBox<>();
    jLabel6 = new javax.swing.JLabel();
    graph = new javax.swing.JPanel();
    graph1 = new javax.swing.JPanel();

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

    Toppanel.setBackground(new java.awt.Color(51, 153, 0));

    jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    jLabel2.setText("KT QU B?N HNG HM NAY:");

    jLabel3.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
    jLabel3.setText("HO? ?N :");

    jLabel4.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
    jLabel4.setText("DOANH THU :");

    tfDoanhSo.setEditable(false);
    tfDoanhSo.setBackground(new java.awt.Color(51, 153, 0));
    tfDoanhSo.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
    tfDoanhSo.setBorder(null);
    tfDoanhSo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            tfDoanhSoActionPerformed(evt);
        }
    });

    tfHoaDon.setEditable(false);
    tfHoaDon.setBackground(new java.awt.Color(51, 153, 0));
    tfHoaDon.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
    tfHoaDon.setBorder(null);
    tfHoaDon.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            tfHoaDonActionPerformed(evt);
        }
    });

    hinhdoanhthu.setBackground(new java.awt.Color(255, 255, 255));

    javax.swing.GroupLayout ToppanelLayout = new javax.swing.GroupLayout(Toppanel);
    Toppanel.setLayout(ToppanelLayout);
    ToppanelLayout.setHorizontalGroup(ToppanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ToppanelLayout.createSequentialGroup().addGroup(ToppanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 234,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(ToppanelLayout.createSequentialGroup().addGap(32, 32, 32)
                            .addGroup(ToppanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(hinhhoadon, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(hinhdoanhthu, javax.swing.GroupLayout.DEFAULT_SIZE, 89,
                                            Short.MAX_VALUE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(ToppanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3).addComponent(jLabel4,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 170,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(65, 65, 65)
                            .addGroup(ToppanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(tfHoaDon, javax.swing.GroupLayout.PREFERRED_SIZE, 157,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(tfDoanhSo, javax.swing.GroupLayout.PREFERRED_SIZE, 222,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(122, Short.MAX_VALUE)));
    ToppanelLayout.setVerticalGroup(ToppanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ToppanelLayout.createSequentialGroup()
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(ToppanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ToppanelLayout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(ToppanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(tfHoaDon, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                            .addGroup(ToppanelLayout.createSequentialGroup().addGap(1, 1, 1)
                                    .addComponent(hinhhoadon, javax.swing.GroupLayout.PREFERRED_SIZE, 57,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(ToppanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ToppanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(tfDoanhSo, javax.swing.GroupLayout.PREFERRED_SIZE, 33,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 37,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(hinhdoanhthu, javax.swing.GroupLayout.PREFERRED_SIZE, 63,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    add(Toppanel, java.awt.BorderLayout.PAGE_START);

    List.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    List.setPreferredSize(new java.awt.Dimension(200, 250));
    List.setLayout(new java.awt.GridBagLayout());

    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    jLabel1.setText("C?C HOT ?NG GN ?Y");
    List.add(jLabel1, new java.awt.GridBagConstraints());

    jScrollPane1.setBorder(null);

    jList1.setBackground(new java.awt.Color(240, 240, 240));
    jList1.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
    jList1.setModel(new javax.swing.AbstractListModel<String>() {
        String[] strings = { " ", " ", "Quang Duy va bn", "\tS mi DS2 nht bn size M", " ", " ",
                "Ng?c trinh va bn ", "\t?p t LV ch 7", " ", " ", "Ph yn va ",
                "\tchnh sa gi bn", " ", " ", "Huy?n My va nhp hng", " ", " ",
                "(Khch hng VIP) Ronaldo va mua", "\t ?p lng Gucci hoa iphone 7" };

        public int getSize() {
            return strings.length;
        }

        public String getElementAt(int i) {
            return strings[i];
        }
    });
    jScrollPane1.setViewportView(jList1);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.1;
    gridBagConstraints.insets = new java.awt.Insets(0, 20, 0, 0);
    List.add(jScrollPane1, gridBagConstraints);

    add(List, java.awt.BorderLayout.LINE_END);

    Detailpanel.setLayout(new java.awt.GridBagLayout());

    jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel5.setText("NHT K? DOANH THU");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 66;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    Detailpanel.add(jLabel5, gridBagConstraints);

    jcbThang.setModel(new javax.swing.DefaultComboBoxModel<>(
            new String[] { "Thng 1", "Thng 2", "Thng 3", "Thng 4", "Thng 5", "Thng 6", "Thng 7",
                    "Thng 8", "Thng 9", "Thng 10", "Thng 11", "Thng 12" }));
    jcbThang.setSelectedIndex(Calendar.getInstance().get(Calendar.MONTH));
    jcbThang.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            jcbThangItemStateChanged(evt);
        }
    });
    jcbThang.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jcbThangActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.ipadx = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
    Detailpanel.add(jcbThang, gridBagConstraints);

    jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel6.setText("TOP 5 SN PHM B?N CHY NHT");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 66;
    Detailpanel.add(jLabel6, gridBagConstraints);

    graph.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.4;
    gridBagConstraints.insets = new java.awt.Insets(4, 10, 2, 0);
    Detailpanel.add(graph, gridBagConstraints);

    graph1.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weighty = 0.4;
    gridBagConstraints.insets = new java.awt.Insets(4, 11, 2, 0);
    Detailpanel.add(graph1, gridBagConstraints);

    add(Detailpanel, java.awt.BorderLayout.CENTER);
}

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.Chromatogram1DViewTopComponent.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 v  a  2 s.  co m
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jToolBar1 = new javax.swing.JToolBar();
    jButton1 = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JToolBar.Separator();
    jLabel1 = new javax.swing.JLabel();
    filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767));
    seriesComboBox = new javax.swing.JComboBox();
    hideShowSeries = new javax.swing.JButton();
    jSeparator3 = new javax.swing.JToolBar.Separator();
    jCheckBox2 = new javax.swing.JCheckBox();

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

    jToolBar1.setRollover(true);

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

    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle
            .getMessage(Chromatogram1DViewTopComponent.class, "Chromatogram1DViewTopComponent.jLabel1.text")); // NOI18N
    jToolBar1.add(jLabel1);
    jToolBar1.add(filler1);

    seriesComboBox.setPrototypeDisplayValue(new SeriesItem(null, "ABCDEFGHIJKLMN", false));
    seriesComboBox.setRenderer(new VisibilityComboBoxRenderer());
    jToolBar1.add(seriesComboBox);

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

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

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

From source file:zet.gui.assignmentEditor.JAssignmentPanel.java

/**
 * Returns the panel on the right side of the {@code JAssignmentPanel} that
 * contains distributions for all properties and a plot of the distribution
 * with the current parameters.//from ww  w. j a v a  2s  .co  m
 * @return the panel on the right side of the {@code JAssignmentPanel}
 */
private JPanel getRightPanel() {
    final JPanel rightPanel = new JPanel(new GridBagLayout());

    final JPanel tableContainer = new JPanel(new BorderLayout());
    tableContainer.add(distributionTable.getTableHeader(), BorderLayout.PAGE_START);
    tableContainer.add(distributionTable, BorderLayout.CENTER);

    rightPanel.add(tableContainer, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    XYSeriesCollection c = new XYSeriesCollection();
    chart = ChartFactory.createXYLineChart(loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Title"),
            loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Values"), // x axis label
            loc.getStringWithoutPrefix("gui.AssignmentEditor.plot.Probability"), // y axis label
            c, // Dataset
            PlotOrientation.VERTICAL, false, true, false // Show legend, tooltips, url
    );

    chartPanel = new ChartPanel(chart);
    rightPanel.add(chartPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    rightPanel.add(chartPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(16, 0, 0, 16), 0, 0));

    return rightPanel;
}

From source file:my.electrochem.ElectrochemUI.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.//w  w  w.j  ava2 s .  c om
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jSeparator1 = new javax.swing.JSeparator();
    fileChooser = new javax.swing.JFileChooser();
    jPanel1 = new javax.swing.JPanel();
    jToolBar1 = new javax.swing.JToolBar();
    jToggleButton1 = new javax.swing.JToggleButton();
    OverlayCurvesBtn = new javax.swing.JButton();
    autoMeasureBtn = new javax.swing.JButton();
    SmoothBtn = new javax.swing.JButton();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    OpenGPES = new javax.swing.JMenuItem();
    Exit = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();

    fileChooser.setCurrentDirectory(new java.io.File("/Users/yerga/Development/GPESfiles"));
    fileChooser.setDialogTitle("Open file...");
    fileChooser.setFileFilter(null);

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setPreferredSize(new java.awt.Dimension(800, 600));

    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel1.setLayout(new java.awt.BorderLayout());
    getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

    jToolBar1.setRollover(true);

    jToggleButton1.setText("Measure");
    jToggleButton1.setFocusable(false);
    jToggleButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jToggleButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jToggleButton1ActionPerformed(evt);
        }
    });
    jToolBar1.add(jToggleButton1);

    OverlayCurvesBtn.setText("Overlay");
    OverlayCurvesBtn.setFocusable(false);
    OverlayCurvesBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    OverlayCurvesBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    OverlayCurvesBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            OverlayCurvesBtnActionPerformed(evt);
        }
    });
    jToolBar1.add(OverlayCurvesBtn);

    autoMeasureBtn.setText("Auto");
    autoMeasureBtn.setFocusable(false);
    autoMeasureBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    autoMeasureBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    autoMeasureBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            autoMeasureBtnActionPerformed(evt);
        }
    });
    jToolBar1.add(autoMeasureBtn);

    SmoothBtn.setText("Smooth");
    SmoothBtn.setFocusable(false);
    SmoothBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    SmoothBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    SmoothBtn.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SmoothBtnActionPerformed(evt);
        }
    });
    jToolBar1.add(SmoothBtn);

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

    jMenu1.setText("File");

    OpenGPES.setText("Open GPES file...");
    OpenGPES.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            OpenGPESActionPerformed(evt);
        }
    });
    jMenu1.add(OpenGPES);

    Exit.setText("Exit");
    Exit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ExitActionPerformed(evt);
        }
    });
    jMenu1.add(Exit);

    jMenuBar1.add(jMenu1);

    jMenu2.setText("Edit");
    jMenuBar1.add(jMenu2);

    setJMenuBar(jMenuBar1);

    pack();
}

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DHeatmapViewerPanel.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 ww  w .  j a v a  2 s.c om*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    jToolBar2 = new javax.swing.JToolBar();
    settingsButton = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jSlider1 = new RangeSlider(0, 1000);
    jCheckBox1 = new javax.swing.JCheckBox();
    jCheckBox2 = new javax.swing.JCheckBox();
    jSeparator1 = new javax.swing.JToolBar.Separator();
    jLabel2 = new javax.swing.JLabel();
    filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767));
    modeSpinner = new javax.swing.JSpinner();
    jSeparator2 = new javax.swing.JToolBar.Separator();
    jLabel3 = new javax.swing.JLabel();
    filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767));
    boxWidthSpinner = new javax.swing.JSpinner();
    filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767));
    jLabel4 = new javax.swing.JLabel();
    filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767));
    boxHeightSpinner = new javax.swing.JSpinner();
    jPanel2 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jSlider2 = new javax.swing.JSlider();

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

    jToolBar2.setFloatable(false);
    jToolBar2.setRollover(true);

    settingsButton.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.settingsButton.text")); // NOI18N
    settingsButton.setFocusable(false);
    settingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    settingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    settingsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            settingsButtonActionPerformed(evt);
        }
    });
    jToolBar2.add(settingsButton);

    java.util.ResourceBundle bundle = java.util.ResourceBundle
            .getBundle("net/sf/maltcms/chromaui/chromatogram1Dviewer/ui/panel/Bundle"); // NOI18N
    jButton1.setText(bundle.getString("Chromatogram1DHeatmapViewerPanel.jButton1.text")); // NOI18N
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jToolBar2.add(jButton1);

    jLabel1.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jLabel1.text")); // NOI18N
    jToolBar2.add(jLabel1);

    jSlider1.setMajorTickSpacing(10);
    jSlider1.setMaximum(1000);
    jSlider1.setMinorTickSpacing(1);
    jSlider1.setValue(0);
    jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jSlider1StateChanged(evt);
        }
    });
    jToolBar2.add(jSlider1);

    jCheckBox1.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jCheckBox1.text")); // NOI18N
    jCheckBox1.setFocusable(false);
    jCheckBox1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBox1ActionPerformed(evt);
        }
    });
    jToolBar2.add(jCheckBox1);

    jCheckBox2.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jCheckBox2.text")); // NOI18N
    jCheckBox2.setFocusable(false);
    jCheckBox2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBox2ActionPerformed(evt);
        }
    });
    jToolBar2.add(jCheckBox2);
    jToolBar2.add(jSeparator1);

    jLabel2.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jLabel2.text")); // NOI18N
    jToolBar2.add(jLabel2);
    jToolBar2.add(filler1);

    modeSpinner.setModel(new javax.swing.SpinnerListModel(new String[] { "ON_CLICK", "ON_HOVER" }));
    modeSpinner.setToolTipText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.modeSpinner.toolTipText")); // NOI18N
    modeSpinner.setMinimumSize(new java.awt.Dimension(120, 28));
    modeSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            modeSpinnerStateChanged(evt);
        }
    });
    jToolBar2.add(modeSpinner);
    jToolBar2.add(jSeparator2);

    jLabel3.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jLabel3.text")); // NOI18N
    jToolBar2.add(jLabel3);
    jToolBar2.add(filler2);

    boxWidthSpinner.setModel(
            new javax.swing.SpinnerNumberModel(1.0d, 9.999999747378752E-5d, 1000.0d, 0.009999999776482582d));
    boxWidthSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            boxWidthSpinnerStateChanged(evt);
        }
    });
    jToolBar2.add(boxWidthSpinner);
    jToolBar2.add(filler3);

    jLabel4.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class,
            "Chromatogram1DHeatmapViewerPanel.jLabel4.text")); // NOI18N
    jToolBar2.add(jLabel4);
    jToolBar2.add(filler4);

    boxHeightSpinner.setModel(
            new javax.swing.SpinnerNumberModel(1.0d, 9.999999747378752E-5d, 1000.0d, 0.009999999776482582d));
    boxHeightSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            boxHeightSpinnerStateChanged(evt);
        }
    });
    jToolBar2.add(boxHeightSpinner);

    jPanel1.add(jToolBar2, java.awt.BorderLayout.PAGE_START);

    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel1.add(jPanel2, java.awt.BorderLayout.CENTER);

    jSlider2.setMajorTickSpacing(25);
    jSlider2.setMaximum(99);
    jSlider2.setMinorTickSpacing(10);
    jSlider2.setPaintLabels(true);
    jSlider2.setPaintTicks(true);
    jSlider2.setSnapToTicks(true);
    jSlider2.setValue(0);
    jSlider2.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jSlider2StateChanged(evt);
        }
    });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel3Layout.createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 1183,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap(31, Short.MAX_VALUE)
                    .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(17, 17, 17)));

    jPanel1.add(jPanel3, java.awt.BorderLayout.PAGE_END);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE));
}

From source file:ui.panel.UILicenseAdd.java

public JPanel createButtonPanel() {
    JPanel panel = p.createPanel(Layouts.flow);
    panel.setLayout(new FlowLayout(FlowLayout.CENTER));

    btnSubmit = b.createButton("Submit");
    btnCancel = b.createButton("Cancel");

    btnSubmit.addActionListener(new ActionListener() {

        @Override//from   w ww.jav a 2 s  .  c  om
        public void actionPerformed(ActionEvent e) {

            SwingWorker<Void, Void> mySwingWorker = new SwingWorker<Void, Void>() {
                @Override
                protected Void doInBackground() throws Exception {
                    TreePath[] path = checkTreeManager.getSelectionModel().getSelectionPaths();
                    ArrayList<String> featureL = new ArrayList<String>();
                    String[] features = new String[] {};
                    for (TreePath tp : path) {

                        if (tp.getLastPathComponent().toString().equals("Features")) {
                            Object rootNode = tree.getModel().getRoot();
                            int parentCount = tree.getModel().getChildCount(rootNode);
                            for (int i = 0; i < parentCount; i++) {
                                Object parentNode = tree.getModel().getChild(rootNode, i);
                                int childrenCount = tree.getModel().getChildCount(parentNode);

                                for (int x = 0; x < childrenCount; x++) {
                                    MyDataNode node = (MyDataNode) tree.getModel().getChild(parentNode, x);
                                    featureL.add(node.getValue());
                                }
                            }
                        } else if (tp.getPathCount() == 2) {
                            Object rootNode = tree.getModel().getRoot();
                            int parentCount = tree.getModel().getChildCount(rootNode);
                            for (int i = 0; i < parentCount; i++) {
                                Object parentNode = tree.getModel().getChild(rootNode, i);
                                if (parentNode.toString().equals(tp.getLastPathComponent().toString())) {

                                    int childrenCount = tree.getModel().getChildCount(parentNode);

                                    for (int x = 0; x < childrenCount; x++) {
                                        MyDataNode node = (MyDataNode) tree.getModel().getChild(parentNode, x);
                                        featureL.add(node.getValue());
                                    }
                                }
                            }
                        } else if (tp.getPathCount() == 3) {
                            MyDataNode node = (MyDataNode) tp.getLastPathComponent();
                            featureL.add(node.getValue());
                        }

                    }
                    features = featureL.toArray(features);
                    String duration = spnValidity.getValue().toString();
                    if (cbPerpetual.isSelected()) {
                        duration = "-1";
                    }
                    String storage = spnCloud.getValue().toString();
                    String maxVCA = spnConcurrentVCA.getValue().toString();
                    String response = apiCall.addNodeLicense(Data.targetURL, Data.sessionKey, Data.bucketID,
                            features, duration, storage, maxVCA);

                    try {
                        JSONObject responseObject = new JSONObject(response);
                        if (responseObject.get("result").equals("ok")) {
                            Data.mainFrame.uiLicenseDetail.getLicenseData();
                            Data.mainFrame.showPanel("license");
                        }
                    } catch (JSONException e1) {
                        e1.printStackTrace();
                    }
                    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 License..."), BorderLayout.PAGE_START);
            dialog.add(panel);
            dialog.pack();
            dialog.setBounds(50, 50, 300, 100);
            dialog.setLocationRelativeTo(Data.mainFrame);
            dialog.setVisible(true);
        }
    });

    btnCancel.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            Data.mainFrame.showPanel("license");
        }
    });

    panel.add(btnSubmit);
    panel.add(btnCancel);

    return panel;
}