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
This commit is contained in:
mdb
2002-11-12 08:18:36 +00:00
parent a00d0634ff
commit da0e6968d5
@@ -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;
}