Java Code Examples for javax.swing.JPanel#setDoubleBuffered()

The following examples show how to use javax.swing.JPanel#setDoubleBuffered() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: ramus   File: FilePlugin.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void open() {
    JPanel contentPane = new JPanel();
    contentPane.setDoubleBuffered(true);
    JFileChooser chooser = new JFileChooser();
    chooser.setFileFilter(fileFilter);
    if (FilePlugin.this.getFile() == null) {
        String file = Options.getString(LAST_FILE);
        if (file != null) {
            chooser.setSelectedFile(new File(file));
        }
    } else
        chooser.setSelectedFile(FilePlugin.this.getFile());
    int r = chooser.showOpenDialog(framework.getMainFrame());
    if (r == JFileChooser.APPROVE_OPTION) {
        File f = chooser.getSelectedFile();
        loadFile(f);

    }

}
 
Example 2
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 3
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 4
Source Project: jdk8u60   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 5
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 6
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 7
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 8
Source Project: jdk8u-jdk   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 9
Source Project: hottub   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 10
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 11
Source Project: openjdk-8   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 12
Source Project: jdk8u_jdk   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 13
Source Project: jdk8u-jdk   File: TSFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}
 
Example 14
NonOpaqueJFrame() {
    super("NonOpaque Swing JFrame");
    JPanel p = new JPanel() {
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            render(g, getWidth(), getHeight(), true);
            g.setColor(Color.red);
            g.drawString("Non-Opaque Swing JFrame", 10, 15);
        }
    };
    p.setDoubleBuffered(false);
    p.setOpaque(false);
    add(p);
    setUndecorated(true);
}