javax.swing.JScrollPane.setMaximumSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中javax.swing.JScrollPane.setMaximumSize()方法的一些代码示例,展示了JScrollPane.setMaximumSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.setMaximumSize()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:setMaximumSize

JScrollPane.setMaximumSize介绍

暂无

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

amScrollPane.setMaximumSize(size);
amScrollPane.setPreferredSize(size);
stScrollPane.setMaximumSize(size);
stScrollPane.setPreferredSize(size);
mdScrollPane.setMaximumSize(size);
mdScrollPane.setPreferredSize(size);
rightPanelTabs.setMaximumSize(size);

代码示例来源:origin: nodebox/nodebox

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);

代码示例来源:origin: magefree/mage

private void setGUISize() {
  textAreaScrollPane.setMaximumSize(new Dimension(getParent().getWidth(), GUISizeHelper.gameDialogAreaTextHeight));
  textAreaScrollPane.setPreferredSize(new Dimension(getParent().getWidth(), GUISizeHelper.gameDialogAreaTextHeight));

代码示例来源:origin: nodebox/nodebox

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);

代码示例来源:origin: fossasia/neurolab-desktop

feedbackSettingsScroller.setMaximumSize(new Dimension(windowWidth, 180));

代码示例来源:origin: pentaho/mondrian

jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());

代码示例来源:origin: pentaho/mondrian

jScrollPaneCDATA.setMaximumSize(cdataTextArea.getPreferredSize());

代码示例来源:origin: magefree/mage

avatarPane.setMaximumSize(new java.awt.Dimension(508, 772));
avatarPane.setMinimumSize(new java.awt.Dimension(508, 772));
avatarPane.setPreferredSize(new java.awt.Dimension(508, 772));

代码示例来源:origin: stackoverflow.com

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);

代码示例来源:origin: org.ihtsdo/wb-api

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

代码示例来源:origin: nativelibs4java/JNAerator

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

代码示例来源:origin: com.nativelibs4java/jnaerator

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

代码示例来源:origin: freeplane/freeplane

/**
 * 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);
}

代码示例来源:origin: nroduit/Weasis

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

代码示例来源:origin: triplea-game/triplea

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;
 }
}

代码示例来源:origin: elki-project/elki

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

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

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

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-gui-minigui

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

代码示例来源:origin: apache/batik

/**
 * 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, ""));
}

代码示例来源:origin: freeplane/freeplane

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:
    }
  }
}

相关文章

JScrollPane类方法