<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          關(guān) 閉

          新聞中心

          EEPW首頁 > 工控自動化 > 設(shè)計應(yīng)用 > 使用J2ME技術(shù)實現(xiàn)手機觸摸屏開發(fā)的方法

          使用J2ME技術(shù)實現(xiàn)手機觸摸屏開發(fā)的方法

          作者: 時間:2008-08-21 來源:網(wǎng)絡(luò) 收藏

            在目錄下的22wtklibdevicesDefaultColorPhoneDefaultColorPhone.properties的文件中有一行touch_screen=false,把它改成true。

            MIDP2.0對于方法有三個:

            1.poerDragged( x, y) 拖拽事件(暫時還沒研究)

            2.pointerPressed(int x, int y) 按壓

            3.pointerReleased(int x, int y) 觸摸屏釋放

            pointerPressed(int x, int y)當(dāng)用戶按下觸摸屏的時候會自動調(diào)用這個方法x,y就是當(dāng)前壓下的坐標(biāo)

            pointerReleased(int x, int y)和pointerPressed(int x, int y)類似相應(yīng)觸摸屏釋放事件

            這里,我只是以相應(yīng)左右軟鍵及菜單事件處理為例:

            protected void pointerPressed(int x, int y) {

            switch (status) {

            case .S_MENU:

            int menuWidth = 90;

            int = 17;

            int = 16;

            int = 10;

            if (x menuWidth y >(

             - ( * + ))) {

            int menuIndex = (y - ( - (

             * + ))) / menuItemHeight;

            doMenuOK(menuIndex);

            }

            case .S_DRAW_DIBIAO_LIST:

            case .S_LOCAL_SEARCH_RESULT:

            case Consts.S_MAP_VIEW:

            // 左右軟鍵40*20的區(qū)域

            if (x 40 y >( - 20)) {

            doCommandLeft();

            }

            if (x >(screenWidth - 40) y >(screenHeight - 20)) {

            doCommandRight();

            }

            break;

            }

            }



          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();