本文整理了Java中javax.swing.JScrollPane.getMaximumSize()
方法的一些代码示例,展示了JScrollPane.getMaximumSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getMaximumSize()
方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getMaximumSize
暂无
代码示例来源: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: nroduit/Weasis
@Override
public void show(Component invoker, int x, int y) {
this.pack();
panelMenus.validate();
int maxsize = scroll.getMaximumSize().height;
int realsize = panelMenus.getPreferredSize().height;
int sizescroll = 0;
if (maxsize < realsize) {
sizescroll = scroll.getVerticalScrollBar().getPreferredSize().width;
}
scroll.setPreferredSize(
new Dimension(scroll.getPreferredSize().width + sizescroll, scroll.getPreferredSize().height));
super.show(invoker, x, y);
}
代码示例来源:origin: triplea-game/triplea
scroll.setMaximumSize(new Dimension(scroll.getMaximumSize().width, DiceImageFactory.DIE_HEIGHT + 17));
scroll.setPreferredSize(new Dimension(scroll.getPreferredSize().width, DiceImageFactory.DIE_HEIGHT + 17));
add(scroll);
内容来源于网络,如有侵权,请联系作者删除!