/** * This method initializes jContentPane * * @return javax.swing.JPanel */ private JPanel getJContentPane() { if (jContentPane == null) { GridLayout gridLayout = new GridLayout(); gridLayout.setRows(1); jContentPane = new JPanel(); jContentPane.setLayout(gridLayout); jContentPane.add(getJScrollPane(), null); } return jContentPane; }
/** * Removes the component from the panel with the Widgets. * * @param comp the component to remove */ public void removeFromWidgetsPanel(Component comp) { if (m_LayoutWidgets != null) m_LayoutWidgets.setRows(m_LayoutWidgets.getRows() - 1); m_PanelWidgets.remove(comp); }
/** * Removes the component from the panel with the buttons. * * @param comp the component to remove */ public void removeFromButtonsPanel(Component comp) { m_LayoutButtons.setRows(m_LayoutButtons.getRows() - 1); m_PanelButtons.remove(comp); } }
/** * Removes the component from the panel with the Widgets. * * @param comp the component to remove */ public void removeFromWidgetsPanel(Component comp) { if (m_LayoutWidgets != null) m_LayoutWidgets.setRows(m_LayoutWidgets.getRows() - 1); m_PanelWidgets.remove(comp); }
/** * Removes the component from the panel with the buttons. * * @param comp the component to remove */ public void removeFromButtonsPanel(Component comp) { m_LayoutButtons.setRows(m_LayoutButtons.getRows() - 1); m_PanelButtons.remove(comp); } }
GridLayout gr=new GridLayout(0, 6); gr.setRows(0); gr.setColumns(6); JPanel cpanel=new JPanel(); cpanel.setLayout(gr); for (int j = 0; j< this.docList.size(); j++){ image = this.docList.get(j); JLabel jl=new JLabel(new ImageIcon(image)); cpanel.add(jl); } this.add(cpanel); // assuming 'this' is the scrollpane you want
/** * This method initializes jContentPane * * @return javax.swing.JPanel */ private JPanel getJContentPane() { if (jContentPane == null) { GridLayout gridLayout = new GridLayout(); gridLayout.setRows(1); jContentPane = new JPanel(); jContentPane.setLayout(gridLayout); jContentPane.add(getJScrollPane(), null); } return jContentPane; }
/** * This method initializes updatePanel * * @return javax.swing.JPanel */ private JPanel getUpdatePanel() { if (updatePanel == null) { updateFrequencyLabel = new JLabel(); updateFrequencyLabel.setText("Frequency of Update"); GridLayout gridLayout1 = new GridLayout(); gridLayout1.setRows(1); updatePanel = new JPanel(); updatePanel.setLayout(gridLayout1); updatePanel.add(updateFrequencyLabel, null); updatePanel.add(getUpdateFrequencyPanel(), null); } return updatePanel; }
private JPanel getPreviewWrapperPanel() { if (previewWrapperPanel == null) { GridLayout gridLayout = new GridLayout(); gridLayout.setRows(1); gridLayout.setColumns(1); previewWrapperPanel = new JPanel(); previewWrapperPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(0, 5, 0, 0), BorderFactory .createTitledBorder(null, "Preview", TitledBorder.CENTER, TitledBorder.BELOW_BOTTOM, null, null))); previewWrapperPanel.setLayout(gridLayout); previewWrapperPanel.add(getPreviewPanel(), null); } return previewWrapperPanel; }
/** * Adds the component to the panel with the buttons. * * @param comp the component to add */ public void addToButtonsPanel(Component comp) { removeFromButtonsPanel(comp); m_LayoutButtons.setRows(m_LayoutButtons.getRows() + 1); m_PanelButtons.add(comp); }
JPanel container1 = new JPanel(new GridLayout(2, 1, 8, 8)); // Or GridLayout gridLayout = new GridLayout(); gridLayout.setRows(2); gridLayout.setColumns(1); gridLayout.setHgap(8); gridLayout.setVgap(8); JPanel container1 = new JPanel(gridLayout);
/** * Adds the component to the panel with the buttons. * * @param comp the component to add */ public void addToButtonsPanel(Component comp) { removeFromButtonsPanel(comp); m_LayoutButtons.setRows(m_LayoutButtons.getRows() + 1); m_PanelButtons.add(comp); }
/** * Adds the component to the panel with the Widgets. * * @param comp the component to add * @param index the index where to add the component, -1 adds the * component at the end */ public void addToWidgetsPanel(Component comp, int index) { removeFromWidgetsPanel(comp); if (m_LayoutWidgets != null) m_LayoutWidgets.setRows(m_LayoutWidgets.getRows() + 1); if (index != -1) m_PanelWidgets.add(comp, index); else m_PanelWidgets.add(comp); }
/** * Adds the component to the panel with the Widgets. * * @param comp the component to add * @param index the index where to add the component, -1 adds the * component at the end */ public void addToWidgetsPanel(Component comp, int index) { removeFromWidgetsPanel(comp); if (m_LayoutWidgets != null) m_LayoutWidgets.setRows(m_LayoutWidgets.getRows() + 1); if (index != -1) m_PanelWidgets.add(comp, index); else m_PanelWidgets.add(comp); }
public <T> void load(List<T> list, Runnable runnable) { this.removeAll(); this.gridLayout.setRows(Math.max(list.size() / COLUMNS, 2)); runnable.run(); if (list.size() < COLUMNS * 2) { for (int i = 0; i < COLUMNS * 2 - list.size(); i++) { JPanel placeholder = new JPanel(); placeholder.setOpaque(false); this.add(placeholder); } } this.getRootPane().repaint(); } }
/** * This method initializes uiConfigurationPanel * * @return javax.swing.JPanel */ private JPanel getUiConfigurationPanel() { if (uiConfigurationPanel == null) { GridLayout gridLayout2 = new GridLayout(); gridLayout2.setRows(2); gridLayout2.setColumns(1); uiConfigurationPanel = new JPanel(); uiConfigurationPanel.setLayout(gridLayout2); uiConfigurationPanel.add(getTrayIconConfigurationPanel(), null); uiConfigurationPanel.setName("UI Configuration"); } return uiConfigurationPanel; }
private void updateSize() { //System.out.println("LegendPanel.updateSize"); if (orientation == VERTICAL) { int nh = 1; if (maxHeight < plotCanvas.getHeight()) { nh = plotCanvas.getHeight() / (maxHeight + inset); } int nw = 1 + legends.size() / nh; ((GridLayout) (container.getLayout())).setColumns(nw); ((GridLayout) (container.getLayout())).setRows(1 + legends.size() / nw); container.setPreferredSize(new Dimension((maxWidth + inset) * nw, (maxHeight + inset) * (1 + legends.size() / nw))); } else if (orientation == HORIZONTAL) { int nw = 1; if (maxWidth < plotCanvas.getWidth()) { nw = plotCanvas.getWidth() / (maxWidth + inset); } int nh = 1 + legends.size() / nw; ((GridLayout) (container.getLayout())).setRows(nh); ((GridLayout) (container.getLayout())).setColumns(1 + legends.size() / nh); container.setPreferredSize(new Dimension((maxWidth + inset) * (1 + legends.size() / nh), (maxHeight + inset) * nh)); } container.updateUI(); }
public void renderMeasurements (final @Nonnull String[][] measurements) { assert EventQueue.isDispatchThread(); innerPanel.removeAll(); gridLayout.setColumns(measurements[0].length); gridLayout.setRows(measurements.length); gridLayout.setHgap(1); gridLayout.setVgap(1); for (int row = 0; row < gridLayout.getRows(); row++) { for (int column = 0; column < gridLayout.getColumns(); column++) { innerPanel.add(new MeasurementPanel(measurements[row][column])); } } innerPanel.validate(); } }
public void renderMeasurements (final @Nonnull String[][] measurements) { assert EventQueue.isDispatchThread(); innerPanel.removeAll(); gridLayout.setColumns(measurements[0].length); gridLayout.setRows(measurements.length); gridLayout.setHgap(1); gridLayout.setVgap(1); for (int row = 0; row < gridLayout.getRows(); row++) { for (int column = 0; column < gridLayout.getColumns(); column++) { innerPanel.add(new MeasurementPanel(measurements[row][column])); } } innerPanel.validate(); } }
public static void init(GridLayout comp, Thing thing, Container parent, ActionContext actionContext){ Integer hgap = JavaCreator.createInteger(thing, "hgap"); if(hgap != null){ comp.setHgap(hgap); } Integer vgap = JavaCreator.createInteger(thing, "vgap"); if(vgap != null){ comp.setVgap(vgap); } Integer cols = JavaCreator.createInteger(thing, "cols"); if(cols != null){ comp.setColumns(cols); } Integer rows = JavaCreator.createInteger(thing, "rows"); if(rows != null){ comp.setRows(rows); } } }