Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7043057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:14:35+00:00 2026-05-28T02:14:35+00:00

I am developing one project using LWUIT, Midlet mobile Application. when I press number

  • 0

I am developing one project using LWUIT, Midlet mobile Application. when I press number keys a dialog box will open. when i press the keys #,0,* Dialog should be close.
I am using Dialog.dispose() method to close dialog. But it is not working. Below is my Code. Can anyone tell me what is the problem in my code?

public class javaForm extends Component implements ActionListener
{

Dialog d=new Dialog();


public void keyPressed(int key){

     System.out.println("Key pressed :"+key);

            switch(key)
            {


                case 48:
                    d.show(130,20,30,30,true);
                    break;
                case 49:
            d.show(130,20,30,30,true);
                    break;
                case 50:
            d.show(130,20,30,30,true);
                    break;
                case 51:
             d.show(130,20,30,30,true);
                    break;
                case 52:
             d.show(130,20,30,30,true);
                    break;
                case 53:
            d.show(130,20,30,30,true);
                    break;
                case 54:
            d.show(130,20,30,30,true);
                    break;
                case 55:
             d.show(130,20,30,30,true);
                    break;
                case 57:
                    d.show(130,20,30,30,true);
                    break;
                case 56:
                     d.show(130,20,30,30,true);
                      break;
                case 42:
            d.dispose();
                        break;
                case 35:
                        d.dispose();
                        break;
                default:
                       d.dispose();
                       break;
            }

}

public void actionPerformed(ActionEvent ae) 

{

 throw new UnsupportedOperationException("Not supported yet.");

}

}

Actually javaForm is a java Program developed using LWUIT and am calling this javaForm inside of MIDLET which is javaForm1. I Included all the Necessary packages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:14:35+00:00Added an answer on May 28, 2026 at 2:14 am

    Why don´t you use Form.addGamekeyListener()?

    Put the gameKeyListener in yout Form (extends ActionListener in the Form)and later in the actionPerformed(ActionEvent ae) capture the key with ae.getKeyEvent and close the Dialog.

    Map the GameKeys with Canvas. For example: Canvas.FIRE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing one web application project using java for education industry.In this Admin have
I am developing iPhone application which is using the 3 projects. One project is
I'm developing a project using the MVVM pattern in WPF. One of the key
We're using cakephp 1.2 version for one of our newly developing project, so would
I am Developing one Windows Smart Phone - 6 Application using C# in .Net
I'm currently developing on a project which uses some TimerJobs. One of the jobs
i am developing one application with map view i need display the weather depends
Hai every one I am developing an windows application in which i have to
I'm developing an application via which one can send sms by directing it to
I'm developing a project using BDD/TDD techniques and I'm trying my best to stay

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.