Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
LwuitアプリケーションExitのキーにコマンドを割り当てることはできますか?#キーを押す#と、Exitコマンドが自動的に呼び出され、アプリケーションが終了します。
Exit
#キーが押されたときに、#のキーコードとexitApplicationを使用して、フォームでKeyPressまたはkeyReleasedイベントをリッスンする必要があります。
protected void keyPressed(int key) { System.out.println("Key Pressed"); if(key==52) //change 52 to match keyCode for # key { Display.getInstance().exitApplication(); } }