Calculate how much u love someone.
Goto http://www.getjar.com/mobile/37628/love-calculator-2/ and download and install in ur J2me supported phone.
Showing posts with label J2me. Show all posts
Showing posts with label J2me. Show all posts
Wednesday, May 12, 2010
Thursday, May 6, 2010
J2ME : Getting softkey events in Canvas in MIDlet
Sometimes it gets an irritating experience when a MIDlet does not take keyEvents for softkeys.
Here is how to get the same :
i)Your canvas should not have any commands & should no implement a Command Listener.
ii)You should make the canvas in fullscreen mode before doing anything else.
Here Is The Code :
Here is how to get the same :
i)Your canvas should not have any commands & should no implement a Command Listener.
ii)You should make the canvas in fullscreen mode before doing anything else.
Here Is The Code :
import javax.microedition.lcdui.*;
public class SoftK extends Canvas
{
//Constructor
public SoftK()
{
this.setFullScreenMode(true);
//Other code here
}
public void paint(Graphics g)
{
//paint code here
}
public void keyPressed(int keyCode)
{
if(keyCode==-7)
{
//Right SoftKey
}
if(keyCode==-6)
{
//LeftSoftKey
}
}
}
Subscribe to:
Posts (Atom)
