當前位置: 首頁>>代碼示例>>Java>>正文


Java JPanel.setDoubleBuffered方法代碼示例

本文整理匯總了Java中javax.swing.JPanel.setDoubleBuffered方法的典型用法代碼示例。如果您正苦於以下問題:Java JPanel.setDoubleBuffered方法的具體用法?Java JPanel.setDoubleBuffered怎麽用?Java JPanel.setDoubleBuffered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JPanel的用法示例。


在下文中一共展示了JPanel.setDoubleBuffered方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: open

import javax.swing.JPanel; //導入方法依賴的package包/類
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);

    }

}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:21,代碼來源:FilePlugin.java

示例2: createComponent

import javax.swing.JPanel; //導入方法依賴的package包/類
public static JComponent createComponent() {
	JPanel panel = new JPanel(new BorderLayout());
	panel.setDoubleBuffered(false);

	panel.add(new JButton("Press me!"), BorderLayout.NORTH);

	JProgressBar bar = new JProgressBar() {
		protected void paintComponent(java.awt.Graphics g) {
			if (g instanceof GLGraphics2D
					) {
				super.paintComponent(g);
			} else {
				System.out.println(g.getClass());
			}
		}
	};
	bar.setIndeterminate(true);
	panel.add(bar, BorderLayout.SOUTH);
	panel.add(new JSlider(SwingConstants.VERTICAL, 0, 10, 3), BorderLayout.EAST);

	ButtonGroup grp = new ButtonGroup();
	JRadioButton radio1 = new JRadioButton("FM");
	JRadioButton radio2 = new JRadioButton("AM");
	grp.add(radio1);
	grp.add(radio2);

	JPanel panel2 = new JPanel(new GridLayout(0, 1));
	panel2.add(radio1);
	panel2.add(radio2);

	JComboBox b = new JComboBox(new String[] {"3", "4"});

	panel.add(b, BorderLayout.WEST);

	panel.setBorder(BorderFactory.createTitledBorder("Border"));

	return panel;
}
 
開發者ID:Harium,項目名稱:propan-jogl-examples,代碼行數:39,代碼來源:Example.java

示例3: NonOpaqueJFrame

import javax.swing.JPanel; //導入方法依賴的package包/類
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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:16,代碼來源:TSFrame.java


注:本文中的javax.swing.JPanel.setDoubleBuffered方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。