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