Example usage for javax.swing JDesktopPane setOpaque

List of usage examples for javax.swing JDesktopPane setOpaque

Introduction

In this page you can find the example usage for javax.swing JDesktopPane 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:MainClass.java

public MainClass() {
    super("Focus Example");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    MyPanel mypanel = new MyPanel();

    JButton button1 = new JButton("One");
    JButton button2 = new JButton("Two");
    JButton button3 = new JButton("Three");
    JButton button4 = new JButton("Four");
    JButton button5 = new MyButton("Five*");
    JButton button6 = new MyButton("Six*");
    JButton button7 = new JButton("Seven");

    mypanel.add(button2);//from   ww  w  .  j  a  v  a 2s.  co m
    mypanel.add(button3);

    JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true);

    frame1.setBackground(Color.lightGray);
    frame1.getContentPane().setLayout(new GridLayout(2, 3));
    frame1.setSize(300, 200);

    frame1.getContentPane().add(button1);
    frame1.getContentPane().add(mypanel);
    frame1.getContentPane().add(button4);
    frame1.getContentPane().add(button5);
    frame1.getContentPane().add(button6);
    frame1.getContentPane().add(button7);

    JDesktopPane desktop = new JDesktopPane();
    desktop.add(frame1, new Integer(1));
    desktop.setOpaque(true);

    // Now set up the user interface window.
    Container contentPane = getContentPane();
    contentPane.add(desktop, BorderLayout.CENTER);
    setSize(new Dimension(400, 300));
    frame1.setVisible(true);
    setVisible(true);
}

From source file:Main.java

public Main() {
    super("Focus Example");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    MyPanel mypanel = new MyPanel();

    JButton button1 = new JButton("One");
    JButton button2 = new JButton("Two");
    JButton button3 = new JButton("Three");
    JButton button4 = new JButton("Four");
    JButton button5 = new MyButton("Five*");
    JButton button6 = new MyButton("Six*");
    JButton button7 = new JButton("Seven");

    mypanel.add(button2);/*from   www.  j a v  a 2  s.  c  o m*/
    mypanel.add(button3);

    JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true);

    frame1.setBackground(Color.lightGray);
    frame1.getContentPane().setLayout(new GridLayout(2, 3));
    frame1.setSize(300, 200);

    frame1.getContentPane().add(button1);
    frame1.getContentPane().add(mypanel);
    frame1.getContentPane().add(button4);
    frame1.getContentPane().add(button5);
    frame1.getContentPane().add(button6);
    frame1.getContentPane().add(button7);

    JDesktopPane desktop = new JDesktopPane();
    desktop.add(frame1, new Integer(1));
    desktop.setOpaque(true);

    // Now set up the user interface window.
    Container contentPane = getContentPane();
    contentPane.add(desktop, BorderLayout.CENTER);
    setSize(new Dimension(400, 300));
    frame1.setVisible(true);
    setVisible(true);
}

From source file:FocusExample.java

public FocusExample() {

    super("Focus Example");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    MyPanel mypanel = new MyPanel();

    JButton button1 = new JButton("One");
    JButton button2 = new JButton("Two");
    JButton button3 = new JButton("Three");
    JButton button4 = new JButton("Four");
    JButton button5 = new MyButton("Five*");
    JButton button6 = new MyButton("Six*");
    JButton button7 = new JButton("Seven");

    mypanel.add(button2);/* ww w  . ja v  a  2  s.c om*/
    mypanel.add(button3);

    JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true);

    frame1.setBackground(Color.lightGray);
    frame1.getContentPane().setLayout(new GridLayout(2, 3));
    frame1.setSize(300, 200);

    frame1.getContentPane().add(button1);
    frame1.getContentPane().add(mypanel);
    frame1.getContentPane().add(button4);
    frame1.getContentPane().add(button5);
    frame1.getContentPane().add(button6);
    frame1.getContentPane().add(button7);

    JDesktopPane desktop = new JDesktopPane();
    desktop.add(frame1, new Integer(1));
    desktop.setOpaque(true);

    //  Now set up the user interface window.
    Container contentPane = getContentPane();
    contentPane.add(desktop, BorderLayout.CENTER);
    setSize(new Dimension(400, 300));
    frame1.setVisible(true);
    setVisible(true);
}