6

Java application won't close normal (from the"x" button)

view full story
linux-howto

http://www.daniweb.com – Hello, i made a basic java desktop application. After building the interface in the form, i compiled it and it worked perfectly. But after i added an event to a button (on click) my app won't close. I use the X button from the title bar, or ctrl+q from the menu but in vain. I am a beginner in swing, would someone tell me what i did wrong?   private void buttonGetMouseClicked(java.awt.event.MouseEvent evt) {         try {             URL url = new URL(jTextField1.getText());             Writer head = new StringWriter();             Writer body = new StringWriter();             alexHttp httpCon = new alexHttp();             httpCon.httpGet(head, body);             HeaderPane.setText(head.toString()); //headerpane [jtextpane]             webpage.setText(body.toString());  //webpage[jeditorpane]             head.close();             body.close();         }catch(Throwable e){             e.printStackTrace();         }     } (General)