protected void installComponents() {
frame = desktopIcon.getInternalFrame();
Icon icon = frame.getFrameIcon();
String title = frame.getTitle();
button = new JButton (title, icon);
button.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent e) {
deiconize(); }} );
button.setFont(desktopIcon.getFont());
button.setBackground(desktopIcon.getBackground());
button.setForeground(desktopIcon.getForeground());
int buttonH = button.getPreferredSize().height;
Icon drag = new MetalBumps((buttonH/3), buttonH,
MetalLookAndFeel.getControlHighlight(),
MetalLookAndFeel.getControlDarkShadow(),
MetalLookAndFeel.getControl());
label = new JLabel(drag);
label.setBorder( new MatteBorder( 0, 2, 0, 1, desktopIcon.getBackground()) );
desktopIcon.setLayout(new BorderLayout(2, 0));
desktopIcon.add(button, BorderLayout.CENTER);
desktopIcon.add(label, BorderLayout.WEST);
}
|