JXCollapsiblePane top = new JXCollapsiblePane() { // @Override // public Dimension getMaximumSize() { // return getPreferredSize(); // } }; top.add(new JLabel("some random label")); top.add(new JLabel("and another")); top.add(new JButton(top.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION))); top.setCollapsed(true); JXFrame frame = new JXFrame("collapsible in top", true); frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.PAGE_AXIS)); frame.add(top, BorderLayout.NORTH); frame.add(new JScrollPane(new JXTable(50, 4))); frame.add(new JButton(top.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION)), BorderLayout.SOUTH); frame.pack(); frame.setVisible(true);
/** * Constructs a new JXCollapsiblePane with a {@link JXPanel} as content pane and the specified * direction. * * @param direction * the direction to collapse the container */ public JXCollapsiblePane(Direction direction) { super.setLayout(new BorderLayout()); this.direction = direction; animator = new AnimationListener(); setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f)); setContentPane(createContentPane()); setDirection(direction); // add an action to automatically toggle the state of the pane getActionMap().put(TOGGLE_ACTION, new ToggleAction()); }
/** * Constructs a new JXCollapsiblePane with a {@link JXPanel} as content pane and the specified * direction. * * @param direction * the direction to collapse the container */ public JXCollapsiblePane(Direction direction) { super.setLayout(new BorderLayout()); this.direction = direction; animator = new AnimationListener(); setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f)); setContentPane(createContentPane()); setDirection(direction); // add an action to automatically toggle the state of the pane getActionMap().put(TOGGLE_ACTION, new ToggleAction()); }
/** * Constructs a new JXCollapsiblePane with a {@link JXPanel} as content pane and the specified * direction. * * @param direction * the direction to collapse the container */ public JXCollapsiblePane(Direction direction) { super.setLayout(new BorderLayout()); this.direction = direction; animator = new AnimationListener(); setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f)); setContentPane(createContentPane()); setDirection(direction); // add an action to automatically toggle the state of the pane getActionMap().put(TOGGLE_ACTION, new ToggleAction()); }
/** * Constructs a new JXCollapsiblePane with a {@link JXPanel} as content pane and the specified * direction. * * @param direction * the direction to collapse the container */ public JXCollapsiblePane(Direction direction) { super.setLayout(new BorderLayout()); this.direction = direction; animator = new AnimationListener(); setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f)); setContentPane(createContentPane()); setDirection(direction); // add an action to automatically toggle the state of the pane getActionMap().put(TOGGLE_ACTION, new ToggleAction()); }
new JButton(collapsePane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION)); collapseButton.setBorderPainted(false); collapseButton.setHideActionText(true);
/** * Constructs a new JXCollapsiblePane with a {@link JPanel} as content pane * and the given LayoutManager and orientation. A vertical orientation * enables a vertical {@link VerticalLayout} with a gap of 2 pixels as * layout manager. A horizontal orientation enables a horizontal * {@link HorizontalLayout} with a gap of 2 pixels as layout manager * * @param direction * the direction this pane collapses * @param layout * of this collapsible pane */ public JXCollapsiblePane(Direction direction, LayoutManager layout) { super.setLayout(layout); this.direction = direction; animator = new AnimationListener(); setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f)); JXPanel panel = new JXPanel(); setContentPane(panel); setDirection(direction); // add an action to automatically toggle the state of the pane getActionMap().put(TOGGLE_ACTION, new ToggleAction()); }