
Hi All,
i am Developing one mobile application using lwuit,Midlet.in that am trying to show a dialog when i press key "0". again if i press key "4" the Dialog should be closed.i leave My sample Code Here.go through and let me know the error.Dialog is showing but after i press key 4, there is know response
import com.sun.lwuit.Dialog;
import com.sun.lwuit.Dialog.*;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import com.sun.lwuit.plaf.Border.*;
public class javaForm extends Component implements ActionListener
{
Dialog d;
javaForm()
{
d=new Dialog();
}
public void keyPressed(int key)
{
System.out.println("Key pressed :"+key);
switch(key)
{
case 48:
d.show();
break;
case 52:
d.dispose();
break;
default:
break;
}
}
public void actionPerformed(ActionEvent ae)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.