import java.awt.*; import oracle.jdeveloper.layout.*; import java.awt.event.*; import java.util.*; import java.io.*; public class XYTestLayout extends Frame { XYLayout xYLayout1 = new XYLayout(); Label lPath = new Label(); TextField tfPath = new TextField(); Button bBrowse = new Button(); Label lSent = new Label(); TextField tfSent = new TextField(); Label lInBox = new Label(); TextField tfInBox = new TextField(); Label lOffLine = new Label(); TextField tfOffLine = new TextField(); Button bUpdate = new Button(); Button bCancel = new Button(); Properties p=new Properties(); public XYTestLayout() { super(); try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } /* public Insets getInsets() { return new Insets(200,200,200,200); }*/ private void jbInit() throws Exception { lPath.setText("Path"); tfPath.setText("tfPath"); bBrowse.setLabel("Browse"); bBrowse.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { bBrowse_actionPerformed(e); } }); lSent.setText("SentFolder"); tfSent.setText("tfSent"); lInBox.setText("InBox Folder"); tfInBox.setText("tfInBox"); lOffLine.setText("OffLine Folder"); tfOffLine.setText("tfOffLine"); bUpdate.setLabel("Update"); bUpdate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { bUpdate_actionPerformed(e); } }); bCancel.setLabel("Cancel"); bCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { bCancel_actionPerformed(e); } }); this.setTitle("Frame Title"); this.addWindowListener(new XYTestLayout_this_windowAdapter(this)); xYLayout1.setHeight(344); xYLayout1.setWidth(509); this.setLayout(xYLayout1); this.setSize(new Dimension(400, 300)); this.setEnabled(true); this.setBackground(SystemColor.control); this.add(lPath, new XYConstraints(2, 5, 92, 29)); this.add(tfPath, new XYConstraints(127, 4, 110, 32)); this.add(bBrowse, new XYConstraints(292, 4, 73, 27)); this.add(lSent, new XYConstraints(3, 43, 87, 28)); this.add(tfSent, new XYConstraints(124, 39, 116, 34)); this.add(lInBox, new XYConstraints(-1, 81, 77, 22)); this.add(tfInBox, new XYConstraints(128, 80, 107, 32)); this.add(lOffLine, new XYConstraints(7, 128, 73, 25)); this.add(tfOffLine, new XYConstraints(121, 121, 115, 30)); this.add(bUpdate, new XYConstraints(65, 169, 69, 21)); this.add(bCancel, new XYConstraints(187, 169, 69, 21)); } void bBrowse_actionPerformed(ActionEvent e) { FileDialog FD=new FileDialog(this,"Path Dialog Box"); FD.show(); tfPath.setText(FD.getFile()); } void bUpdate_actionPerformed(ActionEvent e) { try{ FileOutputStream fos=new FileOutputStream("FMProperties.props"); ObjectOutputStream oostrm=new ObjectOutputStream(fos); oostrm.writeObject(p); } catch(Exception ex){} } void bCancel_actionPerformed(ActionEvent e) { System.exit(0); } void this_windowActivated(WindowEvent e) { try{ FileInputStream fis=new FileInputStream("FMProperties.props"); ObjectInputStream oistrm=new ObjectInputStream(fis); Properties p1=new Properties(); p1=(Properties)oistrm.readObject(); tfPath.setText(p1.getProperty("Path")); tfSent.setText(p1.getProperty("SFN")); tfInBox.setText(p1.getProperty("IFN")); tfOffLine.setText(p1.getProperty("OFN"));} catch(Exception exp){} } } class XYTestLayout_this_windowAdapter extends java.awt.event.WindowAdapter { XYTestLayout adaptee; XYTestLayout_this_windowAdapter(XYTestLayout adaptee) { this.adaptee = adaptee; } public void windowActivated(WindowEvent e) { adaptee.this_windowActivated(e); } }