return new Dimensions(preferredWidth, preferredHeight);
}
public void layout() {
Palette palette = (Palette)getComponent();
int width = getWidth();
int height = getHeight();
// Size/position title bar
titleBarFlowPane.setLocation(1, 1);
titleBarFlowPane.setSize(Math.max(width - 2, 0),
Math.max(titleBarFlowPane.getPreferredHeight(width - 2), 0));
// Size/position content
Component content = palette.getContent();
if (content != null) {
if (content.isDisplayable()) {
content.setVisible(true);