I have a problem in using swing. I don\'t know what is the cause of this but i\'m just trying to create a simple frame app using swing at it give me a lot of error.
This code works for me:
package test;
import javax.swing.JFrame;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setVisible(true);
frame.setSize(100,200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
I only see a difference at
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
where I added the frame. However your stacktrace looks like there's another error, so first try this and if it still don't work, give us a bit more code to look at.