I am trying to figure out how to start and stop a serial interface
Class SerialInterface tool Runnable {// Override public over run of stream file (try {startInterface ()); } Hold (IOException pre) {Logger.getLogger (SerialInterface.class.getName ()). Log (Level.SEVERE, null, ex); }} Public Stable Zero Main (String StartStop) {SerialInterface SerialThread = null; If (StartStop.equals ("Start")) {SerialThread = New SerialInterface (); Thread thread 1 = new thread (serialtread); Thread1.start (); } And {SerialThread = null; }} Private Zero startInterface () throws IOException {// Circle Port from Starting Street} This does not work How do I stop a thread that started?
thread 1.isAlive () A boolean will tell you whether it is alive or not.
Comments
Post a Comment