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 |
---|---|
java.awt.Component |
getComponent()
returns the component wrapped.
|
DockKey |
getDockKey()
returns the unique key identifying the docked element
|
DockKey getDockKey()
java.awt.Component getComponent()
Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.