Java Code Examples for javax.swing.JPanel.setEnabled()

The following are Jave code examples for showing how to use setEnabled() of the javax.swing.JPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: CursorOverlappedPanelsTest.java   View Source Code Vote up 7 votes
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
Example 2
Project: jmt   File: MMQueues.java   View Source Code Vote up 6 votes
private JPanel getSplitter(int widht, int height) {
	JPanel splitPane = new JPanel();
	Dimension dim = new Dimension(widht, height);
	splitPane.setEnabled(false);
	splitPane.setPreferredSize(dim);
	splitPane.setMaximumSize(dim);
	splitPane.setMinimumSize(dim);
	return splitPane;
}
 
Example 3
Project: jdk8u-jdk   File: CursorOverlappedPanelsTest.java   View Source Code Vote up 6 votes
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
Example 4
Project: QN-ACTR-Release   File: MMQueues.java   View Source Code Vote up 5 votes
private JPanel getSplitter(int widht, int height) {
	JPanel splitPane = new JPanel();
	Dimension dim = new Dimension(widht, height);
	splitPane.setEnabled(false);
	splitPane.setPreferredSize(dim);
	splitPane.setMaximumSize(dim);
	splitPane.setMinimumSize(dim);
	return splitPane;
}