Please go through the following example of DebugGraphics class of java:
Code:
import javax.swing.DebugGraphics;
public class DebugGraphicsDM {
public static void main(String[] am) {
JFrame frame1 = new JFrame();
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton bn1 = new JButton();
RepaintManager repaintManager = RepaintManager.currentManager(bn);
repaintManager.setDoubleBufferingEnabled(false);
bn.setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION | DebugGraphics.FLASH_OPTION
| DebugGraphics.LOG_OPTION);
frame1.add(bn1);
frame1.setSize(400, 300);
frame1.setVisible(true);
frame1.add(bn);
}
}
Bookmarks