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:
@@ -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;
|
package com.samskivert.swing;
|
||||||
|
|
||||||
@@ -51,14 +51,22 @@ public class CollapsiblePanel extends JPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a component which contains the trigger button.
|
* Set a component which contains the trigger button. The simple case
|
||||||
* The simple case is to just set the trigger button as this component.
|
* is to just set the trigger button as this component.
|
||||||
*/
|
*/
|
||||||
public void setTriggerContainer (JComponent comp)
|
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.
|
// these are our only two components.
|
||||||
add(comp);
|
add(comp);
|
||||||
add(_content);
|
add(_content = content);
|
||||||
|
|
||||||
// and start us out not showing
|
// and start us out not showing
|
||||||
setCollapsed(true);
|
setCollapsed(true);
|
||||||
@@ -134,5 +142,5 @@ public class CollapsiblePanel extends JPanel
|
|||||||
protected Icon _upIcon, _downIcon;
|
protected Icon _upIcon, _downIcon;
|
||||||
|
|
||||||
/** The who in the what now? */
|
/** The who in the what now? */
|
||||||
protected JPanel _content = new JPanel();
|
protected JPanel _content;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user