1 2 import java.awt.*; 3 import java.awt.event.*; 4 import javax.swing.*; 5 import java.io.*; 6 7 void jButton1_actionPerformed(ActionEvent e) { 8 9 boolean success = (new File("c:\\test1.txt")).delete(); 10 11 if (success == false) { 12 this.setTitle("File Deletion Failed"); 13 } 14 else { 15 this.setTitle("File Deletion success"); 16 } 17 } 18