JDesktopPane.PALETTE_LAYER : JDesktopPane « Swing « Java Tutorial






JDesktopPane.PALETTE_LAYER
import java.awt.BorderLayout;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;


public class InternalFramePaletteSample {
  public static void main(final String[] args) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JDesktopPane desktop = new JDesktopPane();
    
    JInternalFrame palette = new JInternalFrame("Palette", true, false, true, false);
    palette.setBounds(350, 150, 100, 100);
    palette.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
    desktop.add(palette, JDesktopPane.PALETTE_LAYER);
    palette.setVisible(true);

    
    frame.add(desktop, BorderLayout.CENTER);
    frame.setSize(500, 300);
    frame.setVisible(true);
  }
}








14.54.JDesktopPane
14.54.1.JDesktopPane is a specialized JLayeredPane.
14.54.2.Adding Internal Frames to a JDesktopPaneAdding Internal Frames to a JDesktopPane
14.54.3.JDesktopPane.PALETTE_LAYERJDesktopPane.PALETTE_LAYER
14.54.4.extends JDesktopPane implements Scrollable
14.54.5.Getting All Frames in a JDesktopPane Container
14.54.6.Creating a JDesktopPane Container
14.54.7.Create a virtual desktop in your application
14.54.8.Customizing a JDesktopPane Look and Feel