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();
}
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;
}
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();
}
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;
}
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;
}
Aggregations