public interface Dockable
Objects implementing this interface are usually wrappers around user components, or user components themselves.
DockablePanel is a Dockable, and is used to display a
single user Component.
class MyComponent extends JPanel implements Dockable {
// unique key for the docking desktop
DockKey key = new DockKey("MyComponent");
public MyComponent(){
// build your user component here
add(new JButton("Button"));
add(new JTextField("Field"));
// initialize docking properties
key.setName("My Component");
key.setIcon(...);
key.setCloseEnabled(false);
}
public DockKey getDockKey(){
return key;
}
public Component getComponent(){
// this component is the dockable
return this;
}
}
| Modifier and Type | Method and Description |
|---|---|
Component |
getComponent()
returns the component wrapped.
|
DockKey |
getDockKey()
returns the unique key identifying the docked element
|
© Copyright 2004-2013 Lilian Chamontin. All Rights Reserved.