use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.
the class javax_swing_JLayeredPane method getObject.
protected JLayeredPane getObject() {
JLayeredPane pane = new JLayeredPane();
init(pane, 0, 25, 25, 50, 50, Color.RED);
init(pane, 1, 10, 10, 50, 50, Color.BLUE);
init(pane, 2, 40, 40, 50, 50, Color.YELLOW);
pane.setSize(200, 200);
return pane;
}
use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.
the class DimensionEncapsulation method run.
@Override
public void run() {
runTest(new Panel());
runTest(new Button());
runTest(new Checkbox());
runTest(new Canvas());
runTest(new Choice());
runTest(new Label());
runTest(new Scrollbar());
runTest(new TextArea());
runTest(new TextField());
runTest(new Dialog(new JFrame()));
runTest(new Frame());
runTest(new Window(new JFrame()));
runTest(new FileDialog(new JFrame()));
runTest(new List());
runTest(new ScrollPane());
runTest(new JFrame());
runTest(new JDialog(new JFrame()));
runTest(new JWindow(new JFrame()));
runTest(new JLabel("hi"));
runTest(new JMenu());
runTest(new JTree());
runTest(new JTable());
runTest(new JMenuItem());
runTest(new JCheckBoxMenuItem());
runTest(new JToggleButton());
runTest(new JSpinner());
runTest(new JSlider());
runTest(Box.createVerticalBox());
runTest(Box.createHorizontalBox());
runTest(new JTextField());
runTest(new JTextArea());
runTest(new JTextPane());
runTest(new JPasswordField());
runTest(new JFormattedTextField());
runTest(new JEditorPane());
runTest(new JButton());
runTest(new JColorChooser());
runTest(new JFileChooser());
runTest(new JCheckBox());
runTest(new JInternalFrame());
runTest(new JDesktopPane());
runTest(new JTableHeader());
runTest(new JLayeredPane());
runTest(new JRootPane());
runTest(new JMenuBar());
runTest(new JOptionPane());
runTest(new JRadioButton());
runTest(new JRadioButtonMenuItem());
runTest(new JPopupMenu());
//runTest(new JScrollBar()); --> don't test defines max and min in
// terms of preferred
runTest(new JScrollPane());
runTest(new JViewport());
runTest(new JSplitPane());
runTest(new JTabbedPane());
runTest(new JToolBar());
runTest(new JSeparator());
runTest(new JProgressBar());
if (!failures.isEmpty()) {
System.out.println("These classes failed");
for (final Component failure : failures) {
System.out.println(failure.getClass());
}
throw new RuntimeException("Test failed");
}
}
use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.
the class TestDialog method createAndShowGUI.
private static void createAndShowGUI() {
final JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLayeredPane layeredPane = new JLayeredPane();
layeredPane.setPreferredSize(new Dimension(400, 400));
JPanel enabledPanel = createPanel(new Point(10, 10), true);
JPanel disabledPanel = createPanel(new Point(100, 100), false);
layeredPane.add(disabledPanel, JLayeredPane.PALETTE_LAYER);
layeredPane.add(enabledPanel, JLayeredPane.DEFAULT_LAYER);
frame.getContentPane().add(layeredPane);
frame.pack();
frame.setVisible(true);
}
use of javax.swing.JLayeredPane in project cytoscape-impl by cytoscape.
the class SimpleRootPaneContainer method setLayeredPane.
@Override
public void setLayeredPane(JLayeredPane layered) {
final JLayeredPane oldValue = getLayeredPane();
getRootPane().setLayeredPane(layered);
firePropertyChange("layeredPane", oldValue, layered);
}
use of javax.swing.JLayeredPane in project blue by kunstmusik.
the class PaletteWindow method main.
public static void main(String[] args) {
GUI.setBlueLookAndFeel();
JDialog.setDefaultLookAndFeelDecorated(true);
JDialog dialog = new JDialog((Frame) null, "Test");
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.getRootPane().setBorder(new BevelBorder(BevelBorder.RAISED));
dialog.setSize(400, 300);
dialog.setVisible(true);
JDialog dialog2 = new JDialog((Frame) null);
dialog2.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
JLayeredPane layeredPane = dialog2.getRootPane().getLayeredPane();
Component[] comps = layeredPane.getComponentsInLayer(JLayeredPane.FRAME_CONTENT_LAYER.intValue());
for (int i = 0; i < comps.length; i++) {
Component component = comps[i];
if (component != dialog2.getContentPane()) {
JComponent c = ((JComponent) component);
c.setPreferredSize(new Dimension(12, 12));
Component[] subComponents = c.getComponents();
for (int j = 0; j < subComponents.length; j++) {
Component component2 = subComponents[j];
if (component2 instanceof JButton) {
JButton b = (JButton) component2;
b.setIcon(UIManager.getIcon("InternalFrame.paletteCloseIcon"));
b.setPreferredSize(new Dimension(8, 8));
b.setMargin(new Insets(1, 1, 1, 1));
}
}
}
}
dialog2.getRootPane().setBorder(new BevelBorder(BevelBorder.RAISED));
dialog2.setSize(400, 300);
dialog2.setVisible(true);
JDialog.setDefaultLookAndFeelDecorated(false);
JDialog dialog3 = new JDialog((Frame) null, "Test3");
dialog3.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog3.setSize(400, 300);
dialog3.setVisible(true);
}
Aggregations