[Bojangles-cvs] cvs: bojangles / MainWindow.java testAppPrefsDlg.java
Status: Alpha
Brought to you by:
nehresma
From: kai5263499 <boj...@li...> - 2002-09-03 21:01:58
|
kai5263499 Tue Sep 3 14:01:54 2002 EDT Modified files: /bojangles MainWindow.java testAppPrefsDlg.java Log: More work done on synchronizing the mainwindow class and the testappprefsdlg class (so the mainwindow class witll wait for the other one to finish before trying to read it's variables...). Hope yall are all setteling back into your classes up there. Index: bojangles/MainWindow.java diff -u bojangles/MainWindow.java:1.26 bojangles/MainWindow.java:1.27 --- bojangles/MainWindow.java:1.26 Mon Sep 2 20:18:41 2002 +++ bojangles/MainWindow.java Tue Sep 3 14:01:53 2002 @@ -380,16 +380,18 @@ saveXML(false); } if(!prefsSet) { - testAppPrefsDlg testappprefsdlg = new testAppPrefsDlg(); - while(!testappprefsdlg.ready) { - wait(50); + + try { + testAppPrefsDlg testappprefsdlg = new testAppPrefsDlg(); + while(!testappprefsdlg.ready) { + this.wait(); + } + } + catch (InterruptedException e) { + e.printStackTrace(); } - testappprefsdlg.show(); - prefBrowser = testappprefsdlg.browserStr; - prefHost = testappprefsdlg.hostStr; - prefPort = testappprefsdlg.portStr; - prefPath = testappprefsdlg.pathStr; + // Write it to pref.xml! System.out.println("URL af is: http://" + prefHost + ":" + prefPort + "/" + prefPath + "/" + sdir.getName()); Index: bojangles/testAppPrefsDlg.java diff -u bojangles/testAppPrefsDlg.java:1.5 bojangles/testAppPrefsDlg.java:1.6 --- bojangles/testAppPrefsDlg.java:1.5 Mon Sep 2 20:18:41 2002 +++ bojangles/testAppPrefsDlg.java Tue Sep 3 14:01:53 2002 @@ -8,20 +8,31 @@ * <p>Copyright: Copyright (c) 2002 under the GPL</p> * @author Wes */ - -public class testAppPrefsDlg extends javax.swing.JDialog { +//javax.swing.JDialog +public class testAppPrefsDlg extends javax.swing.JDialog implements Runnable { + Thread thread; public String hostStr; public String portStr; public String pathStr; public String browserStr; - public boolean ready = false; + volatile boolean ready = false; /** Creates new form testAppPrefsDlg */ public testAppPrefsDlg() { - initComponents(); - setSize(407,269); + thread = new Thread(this, "testappprefsdlg"); + initComponents(); + setSize(407,269); + thread.start(); } + public void newSuspend() { + ready = false; + } + + synchronized public void newResume() { + ready = true; + } + /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -151,5 +162,13 @@ private javax.swing.JLabel statusBar; private javax.swing.JTextField port; // End of variables declaration + public static void main() { + + } + public void run() { + System.out.println("run?"); + new MainWindow(); + show(); + } } |