01: package DataLoaderTests.DataObjectTest.data.Package;
02:
03: /*
04: * SecurityJApplet.java
05: *
06: * Created on December 16, 1999, 10:39 AM
07: */
08:
09: import java.io.*;
10:
11: /**
12: *
13: * @author pknakal
14: * @version
15: */
16: public class SecurityJApplet extends javax.swing.JApplet {
17:
18: /** Creates new form SecurityJApplet */
19: public SecurityJApplet() {
20: initComponents();
21: }
22:
23: /** This method is called from within the constructor to
24: * initialize the form.
25: * WARNING: Do NOT modify this code. The content of this method is
26: * always regenerated by the FormEditor.
27: */
28: private void initComponents() {//GEN-BEGIN:initComponents
29: 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: getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);
40:
41: jLabel1
42: .setText("Buttun create file in actual directory = \".\"");
43:
44: getContentPane().add(jLabel1, java.awt.BorderLayout.CENTER);
45:
46: }//GEN-END:initComponents
47:
48: private void createFile(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_createFile
49: try {
50: FileOutputStream fstream = new FileOutputStream("Pokus");
51: DataOutputStream dstream = new DataOutputStream(fstream);
52: dstream
53: .writeBytes("*********************************************\n");
54: dstream.flush();
55: dstream.close();
56: } catch (IOException e) {
57: }
58: }//GEN-LAST:event_createFile
59:
60: // Variables declaration - do not modify//GEN-BEGIN:variables
61: private javax.swing.JButton jButton1;
62: private javax.swing.JLabel jLabel1;
63: // End of variables declaration//GEN-END:variables
64:
65: }
|