amScrollPane.setMaximumSize(size); amScrollPane.setPreferredSize(size); stScrollPane.setMaximumSize(size); stScrollPane.setPreferredSize(size); mdScrollPane.setMaximumSize(size); mdScrollPane.setPreferredSize(size); rightPanelTabs.setMaximumSize(size);
JScrollPane notesScroll = new JScrollPane(notesArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); notesScroll.setBorder(BorderFactory.createLineBorder(new Color(137, 137, 137))); notesScroll.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)); notesScroll.setAlignmentX(Component.LEFT_ALIGNMENT); controlsPanel.add(notesScroll);
private void setGUISize() { textAreaScrollPane.setMaximumSize(new Dimension(getParent().getWidth(), GUISizeHelper.gameDialogAreaTextHeight)); textAreaScrollPane.setPreferredSize(new Dimension(getParent().getWidth(), GUISizeHelper.gameDialogAreaTextHeight));
tableScroll.setSize(200, 170); tableScroll.setPreferredSize(new Dimension(200, 170)); tableScroll.setMaximumSize(new Dimension(200, 170)); tableScroll.setMinimumSize(new Dimension(200, 170)); tablePanel.add(tableScroll, BorderLayout.CENTER);
feedbackSettingsScroller.setMaximumSize(new Dimension(windowWidth, 180));
jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());
jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());
avatarPane.setMaximumSize(new java.awt.Dimension(508, 772)); avatarPane.setMinimumSize(new java.awt.Dimension(508, 772)); avatarPane.setPreferredSize(new java.awt.Dimension(508, 772));
JScrollPane scrollPane_1 = new JScrollPane(list); scrollPane_1.setMaximumSize(new Dimension(200, 200)); scrollPane_1.setMinimumSize (new Dimension (200,200)); panel.add(scrollPane_1 , BorderLayout.CENTER);
private void setDefaultValues() { // labels refsetParentLabel = new JLabel("Refset grouping parent (required):"); refsetNameLabel = new JLabel("Grouping name (required):"); // combo box refsetParentComboBox = new DynamicWidthComboBox(getValidParents().toArray()); // text field refsetNameTextField = new JTextArea(); refsetNameTextField.setLineWrap(true); refsetNameTextField.setWrapStyleWord(true); refsetNameScrollPane = new JScrollPane(refsetNameTextField); refsetNameScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); refsetNameScrollPane.setMaximumSize(new Dimension(200, 50)); refsetNameScrollPane.setMinimumSize(new Dimension(200, 50)); refsetNameScrollPane.setPreferredSize(new Dimension(200, 50)); }
public void run() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); PrintStream pout = new PrintStream(bout); DebugUtils.println(SimpleGUI.this.config, pout); JTextArea ta = new JTextArea(); ta.setWrapStyleWord(true); ta.setLineWrap(true); ta.setText(new String(bout.toByteArray())); JScrollPane sp = new JScrollPane(ta); Dimension s = new Dimension(500, 400); ta.setMaximumSize(new Dimension(s.width, Integer.MAX_VALUE)); sp.setMaximumSize(s); sp.setMinimumSize(s); sp.setPreferredSize(s); JOptionPane.showMessageDialog(frame, sp, ftitle, JOptionPane.INFORMATION_MESSAGE); } }));
public void run() { ByteArrayOutputStream bout = new ByteArrayOutputStream(); PrintStream pout = new PrintStream(bout); DebugUtils.println(SimpleGUI.this.config, pout); JTextArea ta = new JTextArea(); ta.setWrapStyleWord(true); ta.setLineWrap(true); ta.setText(new String(bout.toByteArray())); JScrollPane sp = new JScrollPane(ta); Dimension s = new Dimension(500, 400); ta.setMaximumSize(new Dimension(s.width, Integer.MAX_VALUE)); sp.setMaximumSize(s); sp.setMinimumSize(s); sp.setPreferredSize(s); JOptionPane.showMessageDialog(frame, sp, ftitle, JOptionPane.INFORMATION_MESSAGE); } }));
/** * Main method for panel */ public static void main(String[] args) { final List<Color> colorList = new ArrayList<>(100); for(int i = 0; i < 100; i++) colorList.add(Color.WHITE); final JComponent panel = new ColorListEditorPanelBuilder(colorList).getPanel(); JScrollPane jscrollpane = new JRestrictedSizeScrollPane(panel); jscrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); jscrollpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jscrollpane.setMaximumSize(new Dimension(Integer.MAX_VALUE, 600)); JOptionPane.showConfirmDialog(null, jscrollpane); }
public ScrollPopupMenu(Point screenPt) { super(); scroll = new JScrollPane(); panelMenus = new JPanel(); panelMenus.setLayout(new GridLayout(0, 1)); scroll.setViewportView(panelMenus); scroll.setBorder(null); GraphicsConfiguration gc = WinUtil.getGraphicsDeviceConfig(screenPt); scroll.setMaximumSize(new Dimension(scroll.getMaximumSize().width, this.getToolkit().getScreenSize().height - this.getToolkit().getScreenInsets(gc).top - this.getToolkit().getScreenInsets(gc).bottom - 4)); super.add(scroll); }
private JComponent create(final List<Die> dice) { final JPanel dicePanel = new JPanel(); dicePanel.setLayout(new BoxLayout(dicePanel, BoxLayout.X_AXIS)); dicePanel.add(Box.createHorizontalStrut(20)); for (final Die die : dice) { final int roll = die.getValue() + 1; dicePanel.add(new JLabel(uiContext.getDiceImageFactory().getDieIcon(roll, die.getType()))); dicePanel.add(Box.createHorizontalStrut(2)); } final JScrollPane scroll = new JScrollPane(dicePanel); scroll.setBorder(null); scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); // we're adding to a box layout, so to prevent the component from grabbing extra space, set the max height. // allow room for a dice and a scrollbar scroll.setMinimumSize(new Dimension(scroll.getMinimumSize().width, DiceImageFactory.DIE_HEIGHT + 17)); scroll.setMaximumSize(new Dimension(scroll.getMaximumSize().width, DiceImageFactory.DIE_HEIGHT + 17)); scroll.setPreferredSize(new Dimension(scroll.getPreferredSize().width, DiceImageFactory.DIE_HEIGHT + 17)); return scroll; } }
/** * Display the popup, attached to the given component. * * @param parent Parent component */ public void show(Component parent) { Dimension parentSize = parent.getSize(); Insets insets = getInsets(); // reduce the width of the scrollpane by the insets so that the popup // is the same width as the combo box. parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height); Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize(); scroller.setMaximumSize(scrollSize); scroller.setPreferredSize(scrollSize); scroller.setMinimumSize(scrollSize); super.show(parent, 0, parent.getHeight()); tree.requestFocusInWindow(); }
/** * Display the popup, attached to the given component. * * @param parent Parent component */ public void show(Component parent) { Dimension parentSize = parent.getSize(); Insets insets = getInsets(); // reduce the width of the scrollpane by the insets so that the popup // is the same width as the combo box. parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height); Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize(); scroller.setMaximumSize(scrollSize); scroller.setPreferredSize(scrollSize); scroller.setMinimumSize(scrollSize); super.show(parent, 0, parent.getHeight()); tree.requestFocusInWindow(); }
/** * Display the popup, attached to the given component. * * @param parent Parent component */ public void show(Component parent) { Dimension parentSize = parent.getSize(); Insets insets = getInsets(); // reduce the width of the scrollpane by the insets so that the popup // is the same width as the combo box. parentSize.setSize(parentSize.width - (insets.right + insets.left), 10 * parentSize.height); Dimension scrollSize = computePopupBounds(parent, 0, getBounds().height, parentSize.width, parentSize.height).getSize(); scroller.setMaximumSize(scrollSize); scroller.setPreferredSize(scrollSize); scroller.setMinimumSize(scrollSize); super.show(parent, 0, parent.getHeight()); tree.requestFocusInWindow(); }
/** * Initializes this popup menu. */ private void init() { super.removeAll(); scrollPane = new JScrollPane(); scrollPane.setViewportView(menuPanel); scrollPane.setBorder(null); int minWidth = resources.getInteger("ScrollPane.minWidth"); int minHeight = resources.getInteger("ScrollPane.minHeight"); int maxWidth = resources.getInteger("ScrollPane.maxWidth"); int maxHeight = resources.getInteger("ScrollPane.maxHeight"); scrollPane.setMinimumSize(new Dimension(minWidth, minHeight)); scrollPane.setMaximumSize(new Dimension(maxWidth, maxHeight)); scrollPane.setHorizontalScrollBarPolicy (ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(scrollPane, BorderLayout.CENTER); addFooter(new DefaultScrollablePopupMenuItem(this, "")); }
public void editEdgeColorConfiguration(MapModel map) { final List<Color> oldColors = edgeColorsConfigurationFactory.create(map).colors; final ColorListEditorPanelBuilder colorListEditorPanelBuilder = new ColorListEditorPanelBuilder(oldColors); final JComponent panel = colorListEditorPanelBuilder.getPanel(); JScrollPane jscrollpane = new JRestrictedSizeScrollPane(panel); UITools.setScrollbarIncrement(jscrollpane); jscrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); jscrollpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jscrollpane.setMaximumSize(new Dimension(Integer.MAX_VALUE, 600)); String title = TextUtils.getText("editEdgeColors"); final int status = JOptionPane.showConfirmDialog(UITools.getCurrentFrame(), jscrollpane, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); switch(status) { case JOptionPane.OK_OPTION: final List<Color> newColors = colorListEditorPanelBuilder.getColors(); edgeColorsConfigurationFactory.setConfiguration(map, new EdgeColorConfiguration(newColors)); break; default: } } }