/** * Constructs a new DefaultDockable, sets the icon and the title, and * places a component. * @param component the only child of the content pane * @param title the title, to be shown at various places * @param icon the icon, to be shown at various places * @param handling how to understand the <code>icon</code> parameter */ public DefaultDockable( Component component, String title, Icon icon, IconHandling handling ){ super( PropertyKey.DOCKABLE_TITLE, PropertyKey.DOCKABLE_TOOLTIP ); pane.setFocusable( false ); pane.setFocusTraversalPolicyProvider( true ); pane.setFocusTraversalPolicy( new LayoutFocusTraversalPolicy() ); pane.setBackground( background ); if( component != null ){ clientComponent = new WeakReference<Component>( component ); getContentPane().setLayout( new GridLayout( 1, 1 )); getContentPane().add( component ); } setTitleIconHandling( handling ); setTitleIcon( icon ); setTitleText( title ); }