⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startmenu.java

📁 這程式是用J2ME撰寫而成
💻 JAVA
字号:
/*wiseremote - a client/server remote control system for wireless devicesCopyright (C) 2005 Martin ProfittlichThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.*/import javax.microedition.lcdui.*;import javax.microedition.io.Connector;import javax.microedition.io.StreamConnection;import java.util.Vector;class StartMenu extends FixedList implements CommandListener{  Vector addresses;  public StartMenu ()    {      super ("Connect to...");      addresses = new Vector ();      append ("Search", null);      String hosts = WiseremoteMIDlet.instance.getAppProperty ("Hosts");      if (hosts != null)        {          hosts.trim ();          while (hosts.length () > 0)            {              String host;              String addr;              int space = hosts.indexOf (" ");              if (space == -1)                {                  space = hosts.length () - 1;                  host = hosts.substring (0, space + 1);                }              else                {                  host = hosts.substring (0, space);                }              hosts = hosts.substring (space + 1);              hosts.trim ();                            space = hosts.indexOf (" ");              if (space == -1)                {                  space = hosts.length () - 1;                  addr = hosts.substring (0, space + 1);                }              else                {                  addr = hosts.substring (0, space);                }              hosts = hosts.substring (space + 1);              hosts.trim ();              append (host, null);              addresses.addElement (addr);            }        }      else        {           append ("xQ4", null);           addresses.addElement ("btspp://0020e0784449:10;authenticate=false;encrypt=false;master=false");           append ("xMPMC", null);           addresses.addElement ("btspp://0020e0784449:10;authenticate=false;encrypt=false;master=false");        }      Command cmd = new Command ("Select", Command.SCREEN, 1);      setSelectCommand (cmd);      //addCommand (cmd);      //Command backCmd = new Command ("Select", Command.BACK, 1);      //setBackCommand (backCmd);      //addCommand (backCmd);            setCommandListener (this);    }  public void commandAction (Command c, Displayable d)    {      //addEntry ("Selected " + new Integer (getSelectedIndex ()).toString ());      if (c.getLabel () == "Select" && getSelectedIndex () >= 0)        {          if (getSelectedIndex () == 0)            {              //search              WiseremoteMIDlet.instance.display.setCurrent (new Splash ("Searching..."));              ConnectionManager cmgr = new ConnectionManager ();            }          else            {              //connect directly              String url = (String)addresses.elementAt (getSelectedIndex () - 1);              WiseremoteMIDlet.instance.protocol = new Protocol (url);                      /*              if (getSelectedIndex () == 1)                {                  WiseremoteMIDlet.instance.protocol = new Protocol ("btspp://0020e0784449:10;authenticate=false;encrypt=false;master=false");                }              else              if (getSelectedIndex () == 2)                {                  WiseremoteMIDlet.instance.protocol = new Protocol ("btspp://0020e0784449:10;authenticate=false;encrypt=false;master=false");                }                */            }        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -