Example usage for javax.swing JComponent setOpaque

List of usage examples for javax.swing JComponent setOpaque

Introduction

In this page you can find the example usage for javax.swing JComponent setOpaque.

Prototype

@BeanProperty(expert = true, description = "The component's opacity")
public void setOpaque(boolean isOpaque) 

Source Link

Document

If true the component paints every pixel within its bounds.

Usage

From source file:ExtendedDnDDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread.//w w w.java2s.  c o m
 */
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("ExtendedDnDDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new ExtendedDnDDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:ProgressMonitorDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread./*  w ww. j  av  a  2s . co m*/
 */
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("ProgressMonitorDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new ProgressMonitorDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:ExtendedDnDDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from   ww  w  . j  a  v a  2  s .  c o  m*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("ExtendedDnDDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new ExtendedDnDDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:com.clank.launcher.swing.SwingHelper.java

/**
 * Remove all the opaqueness of the given components and child components.
 *
 * @param components list of components// w  w w .  j av  a  2s .  c o  m
 */
public static void removeOpaqueness(@NonNull Component... components) {
    for (Component component : components) {
        if (component instanceof JComponent) {
            JComponent jComponent = (JComponent) component;
            jComponent.setOpaque(false);
            removeOpaqueness(jComponent.getComponents());
        }
    }
}

From source file:misc.InputVerificationDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread.//from   w w w.  j a v  a  2 s  . c  o  m
 */
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("InputVerificationDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new InputVerificationDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:misc.InputVerificationDialogDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread./*from   www. j a  v  a 2 s.  c  o m*/
 */
private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("InputVerificationDialogDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JComponent newContentPane = new InputVerificationDialogDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:InputVerificationDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from www  .  j a va2 s .com*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("InputVerificationDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new InputVerificationDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:JTop.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*www .  j ava 2 s  .  c om*/
private static void createAndShowGUI(JPanel jtop) {
    // Create and set up the window.
    JFrame frame = new JFrame("JTop");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Create and set up the content pane.
    JComponent contentPane = (JComponent) frame.getContentPane();
    contentPane.add(jtop, BorderLayout.CENTER);
    contentPane.setOpaque(true); // content panes must be opaque
    contentPane.setBorder(new EmptyBorder(12, 12, 12, 12));
    frame.setContentPane(contentPane);

    // Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:InputVerificationDialogDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *///from ww  w  . j  av a  2s  .co  m
private static void createAndShowGUI() {
    //We can't set this due to bug #4819813.
    //This bug causes the Java look and feel window
    //decorations to be focusable.
    //JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("InputVerificationDialogDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JComponent newContentPane = new InputVerificationDialogDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:TextInputDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread./*from   w w w.j  a  v  a 2s  .c  o  m*/
 */
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("TextInputDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new TextInputDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}