📄 midletgamehall.java
字号:
}//GEN-BEGIN:|5-switchDisplayable|2| //</editor-fold>//GEN-END:|5-switchDisplayable|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction /** * Called by a system to indicated that a command has been invoked on a particular displayable. * @param command the Command that was invoked * @param displayable the Displayable where the command was invoked */ public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction // write pre-action user code here if (displayable == formChat) {//GEN-BEGIN:|7-commandAction|1|82-preAction if (command == exitCommandLeaveChat) {//GEN-END:|7-commandAction|1|82-preAction leaveRoom(); exitToRoomSelecting();//GEN-LINE:|7-commandAction|2|82-postAction // write post-action user code here } else if (command == okCommandReady) {//GEN-LINE:|7-commandAction|3|80-preAction// setReady(); //GEN-LINE:|7-commandAction|4|80-postAction // write post-action user code here } else if (command == okCommandSend1) {//GEN-LINE:|7-commandAction|5|78-preAction // write pre-action user code here Date time=new Date(); chatProxy.sendMessage(INFO.userAccount, time.toString(), textFieldInput.getString()); textFieldInput.setString("");//GEN-LINE:|7-commandAction|6|78-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|7|26-preAction } else if (displayable == formLogin) { if (command == exitCommand) {//GEN-END:|7-commandAction|7|26-preAction // write pre-action user code here exitMIDlet();//GEN-LINE:|7-commandAction|8|26-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|9|40-preAction } else if (displayable == formRegister) { if (command == cancelCommand) {//GEN-END:|7-commandAction|9|40-preAction // write pre-action user code here switchDisplayable(null, getFormLogin());//GEN-LINE:|7-commandAction|10|40-postAction // write post-action user code here } else if (command == okCommand1) {//GEN-LINE:|7-commandAction|11|38-preAction // write pre-action user code here register(); //GEN-LINE:|7-commandAction|12|38-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|13|57-preAction } else if (displayable == listGameSelect) { if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|13|57-preAction // write pre-action user code here listGameSelectAction();//GEN-LINE:|7-commandAction|14|57-postAction // write post-action user code here } else if (command == exitCommandLeaveGameSelect) {//GEN-LINE:|7-commandAction|15|90-preAction // write pre-action user code here logout();//GEN-LINE:|7-commandAction|16|90-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|17|61-preAction } else if (displayable == listRoomSelect) { if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|17|61-preAction // write pre-action user code here listRoomSelectAction();//GEN-LINE:|7-commandAction|18|61-postAction // write post-action user code here } else if (command == exitCommandLeaveRoomSelect) {//GEN-LINE:|7-commandAction|19|92-preAction // write pre-action user code here exitToGameSelecting();//GEN-LINE:|7-commandAction|20|92-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|21|7-postCommandAction }//GEN-END:|7-commandAction|21|7-postCommandAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|22| //</editor-fold>//GEN-END:|7-commandAction|22| //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Items ">//GEN-BEGIN:|8-itemCommandAction|0|8-preItemCommandAction /** * Called by a system to indicated that a command has been invoked on a particular item. * @param command the Command that was invoked * @param displayable the Item where the command was invoked */ public void commandAction(Command command, Item item) {//GEN-END:|8-itemCommandAction|0|8-preItemCommandAction // write pre-action user code here if (item == imageItem1) {//GEN-BEGIN:|8-itemCommandAction|1|28-preAction if (command == itemCommandLogin) {//GEN-END:|8-itemCommandAction|1|28-preAction // write pre-action user code here login();//GEN-LINE:|8-itemCommandAction|2|28-postAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|3|30-preAction } else if (item == imageItem2) { if (command == itemCommandRegister) {//GEN-END:|8-itemCommandAction|3|30-preAction // write pre-action user code here switchDisplayable(null, getFormRegister());//GEN-LINE:|8-itemCommandAction|4|30-postAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|5|8-postItemCommandAction }//GEN-END:|8-itemCommandAction|5|8-postItemCommandAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|6| //</editor-fold>//GEN-END:|8-itemCommandAction|6| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formLogin ">//GEN-BEGIN:|13-getter|0|13-preInit /** * Returns an initiliazed instance of formLogin component. * @return the initialized component instance */ public Form getFormLogin() { if (formLogin == null) {//GEN-END:|13-getter|0|13-preInit // write pre-init user code here formLogin = new Form("\u767B\u9646", new Item[] { getImageItem(), getTextFieldUsername(), getTextFieldPassword(), getImageItem1(), getImageItem2() });//GEN-BEGIN:|13-getter|1|13-postInit formLogin.addCommand(getExitCommand()); formLogin.setCommandListener(this);//GEN-END:|13-getter|1|13-postInit // write post-init user code here }//GEN-BEGIN:|13-getter|2| return formLogin; } //</editor-fold>//GEN-END:|13-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem ">//GEN-BEGIN:|14-getter|0|14-preInit /** * Returns an initiliazed instance of imageItem component. * @return the initialized component instance */ public ImageItem getImageItem() { if (imageItem == null) {//GEN-END:|14-getter|0|14-preInit // write pre-init user code here imageItem = new ImageItem("3G\u6E38\u620F\u5E73\u53F0", getImage1(), ImageItem.LAYOUT_CENTER, "<Missing Image>", Item.PLAIN);//GEN-LINE:|14-getter|1|14-postInit // write post-init user code here }//GEN-BEGIN:|14-getter|2| return imageItem; } //</editor-fold>//GEN-END:|14-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: textFieldUsername ">//GEN-BEGIN:|17-getter|0|17-preInit /** * Returns an initiliazed instance of textFieldUsername component. * @return the initialized component instance */ public TextField getTextFieldUsername() { if (textFieldUsername == null) {//GEN-END:|17-getter|0|17-preInit // write pre-init user code here textFieldUsername = new TextField("\u7528\u6237\u540D", null, 32, TextField.ANY);//GEN-LINE:|17-getter|1|17-postInit // write post-init user code here }//GEN-BEGIN:|17-getter|2| return textFieldUsername; } //</editor-fold>//GEN-END:|17-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: textFieldPassword ">//GEN-BEGIN:|18-getter|0|18-preInit /** * Returns an initiliazed instance of textFieldPassword component. * @return the initialized component instance */ public TextField getTextFieldPassword() { if (textFieldPassword == null) {//GEN-END:|18-getter|0|18-preInit // write pre-init user code here textFieldPassword = new TextField("\u5BC6\u7801", null, 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|18-getter|1|18-postInit // write post-init user code here }//GEN-BEGIN:|18-getter|2| return textFieldPassword; } //</editor-fold>//GEN-END:|18-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem1 ">//GEN-BEGIN:|19-getter|0|19-preInit /** * Returns an initiliazed instance of imageItem1 component. * @return the initialized component instance */ public ImageItem getImageItem1() { if (imageItem1 == null) {//GEN-END:|19-getter|0|19-preInit // write pre-init user code here imageItem1 = new ImageItem("\u767B\u9646", getImage2(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-BEGIN:|19-getter|1|19-postInit imageItem1.addCommand(getItemCommandLogin()); imageItem1.setItemCommandListener(this);//GEN-END:|19-getter|1|19-postInit // write post-init user code here }//GEN-BEGIN:|19-getter|2| return imageItem1; } //</editor-fold>//GEN-END:|19-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem2 ">//GEN-BEGIN:|21-getter|0|21-preInit /** * Returns an initiliazed instance of imageItem2 component. * @return the initialized component instance */ public ImageItem getImageItem2() { if (imageItem2 == null) {//GEN-END:|21-getter|0|21-preInit // write pre-init user code here imageItem2 = new ImageItem("\u6CE8\u518C", getImage3(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-BEGIN:|21-getter|1|21-postInit imageItem2.addCommand(getItemCommandRegister()); imageItem2.setItemCommandListener(this);//GEN-END:|21-getter|1|21-postInit // write post-init user code here }//GEN-BEGIN:|21-getter|2| return imageItem2; } //</editor-fold>//GEN-END:|21-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand ">//GEN-BEGIN:|23-getter|0|23-preInit /** * Returns an initiliazed instance of okCommand component. * @return the initialized component instance */ public Command getOkCommand() { if (okCommand == null) {//GEN-END:|23-getter|0|23-preInit // write pre-init user code here okCommand = new Command("OK", Command.OK, 0);//GEN-LINE:|23-getter|1|23-postInit // write post-init user code here }//GEN-BEGIN:|23-getter|2| return okCommand; } //</editor-fold>//GEN-END:|23-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|25-getter|0|25-preInit /** * Returns an initiliazed instance of exitCommand component. * @return the initialized component instance */ public Command getExitCommand() { if (exitCommand == null) {//GEN-END:|25-getter|0|25-preInit // write pre-init user code here exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|25-getter|1|25-postInit // write post-init user code here }//GEN-BEGIN:|25-getter|2| return exitCommand; } //</editor-fold>//GEN-END:|25-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommandLogin ">//GEN-BEGIN:|27-getter|0|27-preInit /** * Returns an initiliazed instance of itemCommandLogin component. * @return the initialized component instance */ public Command getItemCommandLogin() { if (itemCommandLogin == null) {//GEN-END:|27-getter|0|27-preInit // write pre-init user code here itemCommandLogin = new Command("\u9009\u62E9", Command.ITEM, 0);//GEN-LINE:|27-getter|1|27-postInit // write post-init user code here }//GEN-BEGIN:|27-getter|2| return itemCommandLogin; } //</editor-fold>//GEN-END:|27-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommandRegister ">//GEN-BEGIN:|29-getter|0|29-preInit /** * Returns an initiliazed instance of itemCommandRegister component. * @return the initialized component instance */ public Command getItemCommandRegister() { if (itemCommandRegister == null) {//GEN-END:|29-getter|0|29-preInit // write pre-init user code here itemCommandRegister = new Command("\u9009\u62E9", Command.ITEM, 0);//GEN-LINE:|29-getter|1|29-postInit // write post-init user code here }//GEN-BEGIN:|29-getter|2| return itemCommandRegister; } //</editor-fold>//GEN-END:|29-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|15-getter|0|15-preInit /** * Returns an initiliazed instance of image1 component. * @return the initialized component instance */ public Image getImage1() { if (image1 == null) {//GEN-END:|15-getter|0|15-preInit // write pre-init user code here try {//GEN-BEGIN:|15-getter|1|15-@java.io.IOException image1 = Image.createImage("/Desktop.png"); } catch (java.io.IOException e) {//GEN-END:|15-getter|1|15-@java.io.IOExceptione.printStackTrace (); }//GEN-LINE:|15-getter|2|15-postInit // write post-init user code here }//GEN-BEGIN:|15-getter|3| return image1; } //</editor-fold>//GEN-END:|15-getter|3| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: image2 ">//GEN-BEGIN:|20-getter|0|20-preInit /** * Returns an initiliazed instance of image2 component. * @return the initialized component instance
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -