this program in notepad is correct i run it in cmd
but this is not correct in netbeans
the error is non-static variable this cannot be referenced from a static contex
i change the SimpleFrame class up the SimpleFrameTest i run my program in netbeans
this is not run notepad
i do not understand!?
import javax.swing.*; public class SimpleFrameTest { public static void main(String[] args) { SimpleFrame frame = new SimpleFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E); frame.setVisible(true); } } class SimpleFrame extends JFrame { public SimpleFrame() { setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); } public static final int DEFAULT_WIDTH = 300; public static final int DEFAULT_HEIGHT = 200; }