-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDebugSwing.java
More file actions
31 lines (28 loc) · 921 Bytes
/
DebugSwing.java
File metadata and controls
31 lines (28 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package debugging;
import javax.swing.*;
/**
* Created by husiv on 10/11/16.
*/
public class DebugSwing {
public static void main(String[] args) throws Exception {
JFrame jFrame = getFrame();
JPanel jPanel = new JPanel();
jFrame.add(jPanel);
JButton button = new JButton("submit");
//1
//ctrl+shift+f1
//2
button.setDebugGraphicsOptions(DebugGraphics.LOG_OPTION);
jPanel.add(button);
//3
RepaintManager.currentManager(jFrame.getRootPane()).setDoubleBufferingEnabled(false);
((JComponent)jFrame.getContentPane()).setDebugGraphicsOptions(DebugGraphics.FLASH_OPTION);
}
static JFrame getFrame() {
JFrame jFrame = new JFrame() {};
jFrame.setVisible(true);
jFrame.setBounds(750, 250, 500 ,500);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
return jFrame;
}
}