Search in sources :

Example 96 with GridLayout

use of java.awt.GridLayout in project CoreNLP by stanfordnlp.

the class InputPanel method showHistory.

private void showHistory() {
    if (historyFrame == null) {
        historyFrame = new JFrame("Statistics History");
    } else {
        historyFrame.setVisible(false);
        historyFrame = new JFrame("Statistics History");
    }
    historyFrame.setLayout(new GridLayout(1, 0));
    Object[][] entries = new Object[historyList.size()][3];
    for (int i = 0; i < historyList.size(); i++) {
        entries[i] = historyList.get(i).toArray();
    }
    DefaultTableModel tableModel = new TregexGUITableModel(entries, HistoryEntry.columnNamesArray());
    JTable statTable = new JTable(tableModel);
    DefaultTableCellRenderer dtcr = (DefaultTableCellRenderer) statTable.getDefaultRenderer(String.class);
    dtcr.setHorizontalAlignment(DefaultTableCellRenderer.CENTER);
    JScrollPane scroller = new JScrollPane(statTable);
    historyFrame.add(scroller);
    historyFrame.pack();
    historyFrame.setLocationRelativeTo(TregexGUI.getInstance());
    historyFrame.setBackground(Color.WHITE);
    historyFrame.setVisible(true);
    historyFrame.repaint();
}
Also used : GridLayout(java.awt.GridLayout) DefaultTableModel(javax.swing.table.DefaultTableModel) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 97 with GridLayout

use of java.awt.GridLayout in project EnrichmentMapApp by BaderLab.

the class SettingsPopupPanel method createButtonPanel.

private static JPanel createButtonPanel(JRadioButton... buttons) {
    JPanel panel = new JPanel(new GridLayout(buttons.length, 1));
    ButtonGroup group = new ButtonGroup();
    for (JRadioButton button : buttons) {
        panel.add(button);
        group.add(button);
        SwingUtil.makeSmall(button);
    }
    panel.setOpaque(false);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup)

Example 98 with GridLayout

use of java.awt.GridLayout in project DistributedFractalNetwork by Budder21.

the class NetworkView method setNetworkElements.

/**
	 * Used to set all the network elements of this display
	 * @param elements all the elements to be displayed
	 */
public void setNetworkElements(ArrayList<NetworkElement> elements) {
    this.elements = elements;
    panel.removeAll();
    int numRows = elements.size() >= Display.DISPLAY_HEIGHT / NetworkElement.HEIGHT ? elements.size() : Display.DISPLAY_HEIGHT / NetworkElement.HEIGHT;
    panel.setLayout(new GridLayout(numRows, 1));
    int count = 0;
    for (; count < numRows - elements.size(); count++) {
        JPanel temp = new JPanel();
        temp.setBackground(Color.WHITE);
        panel.add(temp, count, 0);
    }
    count = 0;
    for (NetworkElement e : elements) {
        //JSeparator sep = new JSeparator();
        //panel.add(sep, count++, 0);
        panel.add(elements.get(elements.size() - count - 1), count++, 0);
    }
    this.revalidate();
    this.repaint();
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout)

Example 99 with GridLayout

use of java.awt.GridLayout in project ACS by ACS-Community.

the class Example method createWindow.

// Proprietary helpers for this Demo
// ===================================================
JPanel createWindow() {
    JPanel panel = new JPanel(new GridLayout(0, 1, 10, 10));
    JDialog d = new JDialog((JDialog) null, "Example", false);
    d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    d.add(panel);
    d.setSize(300, 200);
    d.setVisible(true);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JDialog(javax.swing.JDialog)

Example 100 with GridLayout

use of java.awt.GridLayout in project ACS by ACS-Community.

the class ErrorTreeCellRenderer method getTableViewPanel.

/**
	 * This method initializes jPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
private JPanel getTableViewPanel() {
    if (tableViewPanel == null) {
        GridLayout gridLayout = new GridLayout();
        gridLayout.setRows(1);
        tableViewPanel = new JPanel();
        tableViewPanel.setLayout(gridLayout);
        tableViewPanel.add(getNodesPanel(), null);
    }
    return tableViewPanel;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout)

Aggregations

GridLayout (java.awt.GridLayout)142 JPanel (javax.swing.JPanel)106 JLabel (javax.swing.JLabel)54 BorderLayout (java.awt.BorderLayout)50 Dimension (java.awt.Dimension)32 JButton (javax.swing.JButton)32 ActionEvent (java.awt.event.ActionEvent)29 JScrollPane (javax.swing.JScrollPane)27 ActionListener (java.awt.event.ActionListener)25 JTextField (javax.swing.JTextField)23 Insets (java.awt.Insets)21 JCheckBox (javax.swing.JCheckBox)21 GridBagConstraints (java.awt.GridBagConstraints)17 GridBagLayout (java.awt.GridBagLayout)17 TitledBorder (javax.swing.border.TitledBorder)17 PlotCanvas (smile.plot.PlotCanvas)16 BoxLayout (javax.swing.BoxLayout)15 EmptyBorder (javax.swing.border.EmptyBorder)15 FlowLayout (java.awt.FlowLayout)13 ButtonGroup (javax.swing.ButtonGroup)10