/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package mmc; /** * * @author meta */ public class btHandler implements Runnable { public final static int TODO_SERVICES = 1; public final static int TODO_DEVICES = 2; private mmcMenu parent; private int todo; public btHandler(mmcMenu gui) { parent = gui; } public void run() { switch (todo) { case TODO_DEVICES: dDevices(); break; case TODO_SERVICES: dServices(); break; } } // a method for discovering devices private void dDevices() {} public void discoverDevices() { todo = TODO_DEVICES; Thread t = new Thread(this); t.start(); } // a method for discovering the services of the (the previously discovered, or a specified one) macs private void dServices() {} public void discoverServices() { todo = TODO_SERVICES; Thread t = new Thread(this); t.start(); } }