List of utility methods to do JScrollPane Create
Component | getScrollPane(Component innerComponent) get Scroll Pane Component component = innerComponent; if ((innerComponent instanceof JScrollPane)) { return innerComponent; if ((component.getParent() != null) && (component.getParent().getParent() != null) && ((component.getParent().getParent() instanceof JScrollPane))) { component = component.getParent().getParent(); return component; ... |
JScrollPane | getScrollPane(BasicComboPopup popup) get Scroll Pane return null;
|
JScrollPane | getScrollPane(Component component) Get the JScrollPane that contains the passed in component. return ((JScrollPane) SwingUtilities.getAncestorOfClass(JScrollPane.class, component)); |
JScrollPane | getScrollPane(Component component) Adds a component to a ScrollPane. JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(component); return scrollpane; |
Component | getScrollPane(Component innerComponent) Gets the scroll pane around the component. Component component = innerComponent; if (innerComponent instanceof JScrollPane) { return innerComponent; if (component.getParent() != null && component.getParent().getParent() != null && component.getParent().getParent() instanceof JScrollPane) { component = component.getParent().getParent(); return component; ... |
JScrollPane | getScrollPane(final Component component) Returns scroll pane for specified component if exists, null otherwise. if (component != null && component.getParent() != null && component.getParent() instanceof JViewport && component.getParent().getParent() != null && component.getParent().getParent() instanceof JScrollPane) { return (JScrollPane) component.getParent().getParent(); } else { return null; |
JScrollPane | getScrollPaneAncestor(Component c) Gets the scroll pane that wraps a given component. for (c = c.getParent(); c != null; c = c.getParent()) { if (c instanceof JScrollPane) return (JScrollPane) c; return null; |
Component | getScrollPaneViewComponent(JComponent component) get Scroll Pane View Component if (component instanceof JScrollPane) { return ((JScrollPane) component).getViewport().getView(); return null; |
JScrollPane | makeScrollable(JComponent c) make Scrollable return new JScrollPane(c, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
JScrollPane | makeScrollPane(Component c, int xdim, int ydim) Make a scroll pane for the input box which may be used to hold selection buttons later; size is given; text for a title in box. JScrollPane sp = new JScrollPane(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); JViewport vp = sp.getViewport(); vp.setViewSize(new Dimension(xdim, ydim)); return sp; |