| |
14. 124. 1. 界面调试 |
|
DebugGraphics Settings | Description | DebugGraphics.BUFFERED_OPTION | Causes a window to pop up, displaying the drawing of the double-buffered image | DebugGraphics.FLASH_OPTION | Causes the drawing to be done more slowly, flashing between steps | DebugGraphics.LOG_OPTION | Causes a message to be printed to the screen as each step is done | DebugGraphics.NONE_OPTION | Disables all options |
|
import javax.swing.DebugGraphics;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.RepaintManager;
public class DebugGraphicsDemo {
public static void main(String[] a) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton bn = new JButton();
RepaintManager repaintManager = RepaintManager.currentManager(bn);
repaintManager.setDoubleBufferingEnabled(false);
bn.setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION | DebugGraphics.FLASH_OPTION
| DebugGraphics.LOG_OPTION);
frame.add(bn);
frame.setSize(300, 300);
frame.setVisible(true);
frame.add(bn);
}
}
|
|
14. 124. 界面调试 | | 14. 124. 1. | 界面调试 | | |
|