From da0e6968d5bf155e4f1512a1c9e626334cb0c799 Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 12 Nov 2002 08:18:36 +0000 Subject: [PATCH] Modified the way a collapsible panel gets its initial content. git-svn-id: https://samskivert.googlecode.com/svn/trunk@927 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/swing/CollapsiblePanel.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/CollapsiblePanel.java b/projects/samskivert/src/java/com/samskivert/swing/CollapsiblePanel.java index 6bb13a1c..8a0a8313 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/CollapsiblePanel.java +++ b/projects/samskivert/src/java/com/samskivert/swing/CollapsiblePanel.java @@ -1,5 +1,5 @@ // -// $Id: CollapsiblePanel.java,v 1.4 2002/08/20 18:57:31 mdb Exp $ +// $Id: CollapsiblePanel.java,v 1.5 2002/11/12 08:18:36 mdb Exp $ package com.samskivert.swing; @@ -51,14 +51,22 @@ public class CollapsiblePanel extends JPanel } /** - * Set a component which contains the trigger button. - * The simple case is to just set the trigger button as this component. + * Set a component which contains the trigger button. The simple case + * is to just set the trigger button as this component. */ public void setTriggerContainer (JComponent comp) + { + setTriggerContainer(comp, new JPanel()); + } + + /** + * Set a component which contains the trigger button. + */ + public void setTriggerContainer (JComponent comp, JPanel content) { // these are our only two components. add(comp); - add(_content); + add(_content = content); // and start us out not showing setCollapsed(true); @@ -134,5 +142,5 @@ public class CollapsiblePanel extends JPanel protected Icon _upIcon, _downIcon; /** The who in the what now? */ - protected JPanel _content = new JPanel(); + protected JPanel _content; }