1 package DataLoaderTests.DataObjectTest.data; 2 3 8 9 import java.io.*; 10 11 16 public class SecurityJApplet extends javax.swing.JApplet { 17 18 19 public SecurityJApplet() { 20 initComponents (); 21 } 22 23 28 private void initComponents () { jButton1 = new javax.swing.JButton (); 30 jLabel1 = new javax.swing.JLabel (); 31 32 jButton1.setText ("Push me :-)"); 33 jButton1.addMouseListener (new java.awt.event.MouseAdapter () { 34 public void mouseClicked (java.awt.event.MouseEvent evt) { 35 createFile (evt); 36 } 37 } 38 ); 39 40 41 getContentPane ().add (jButton1, java.awt.BorderLayout.SOUTH); 42 43 jLabel1.setText ("Buttun create file in actual directory = \".\""); 44 45 46 getContentPane ().add (jLabel1, java.awt.BorderLayout.CENTER); 47 48 } 50 private void createFile (java.awt.event.MouseEvent evt) { try { 52 FileOutputStream fstream = new FileOutputStream("Pokus"); 53 DataOutputStream dstream = new DataOutputStream(fstream); 54 dstream.writeBytes("*********************************************\n"); 55 dstream.flush(); 56 dstream.close(); 57 } 58 catch (IOException e) { 59 } 60 } 62 63 private javax.swing.JButton jButton1; 65 private javax.swing.JLabel jLabel1; 66 68 } | Popular Tags |