So, I am just starting out on GUI for java and I am getting a stack overflow error, I am not sure why.
package start; import javax.swing.*; public class HelloWorldSwing extends JFrame { public HelloWorldSwing() { this.setSize(40,40); this.setLocation(0,0); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } //Only makes the frame visible public void show() { this.setVisible(true); } //makes the frame visible and sets the title to title public void show(String title) { this.setTitle(title); this.setVisible(true); } //makes the frame visible, changes its title and sets the location to x,y public void show(String title,int x,int y) { this.setTitle(title); this.setLocation(x,y); this.setVisible(true); } //Hide the frame public void hide() { this.setVisible(false); } public static void main(String[] args) { HelloWorldSwing S=new HelloWorldSwing(); S.show(); } }