Here is a basic program I compiled
and tried to run.
import javax.swing.*;
import java.awt.*;
public class GUITest extends Frame{
public GUITest(){
super("A basic GUI");
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(2,2));
setVisible(true);
}
public static void main(String [] args){
new GUITest();
}
}
When I run it, the window is there but it quickly stops responding and I have to forcibly quit it. I started getting this problem after I tried running the exact same program on Eclipse.
I noticed that the icon of the window in the upper-leftmost corner is not a coffee mug as I would normally expect, rather its a blank window. How can I fix this?