Struggling with OnKeyPressed Event in java
Hi there
Iam struggling with the OnKeyPressed event in java.
This code doesn't work and it doesn't display anything
I want to know why
public void OnKeyPressed(Object source, KeyEvent e)
{
System.err.println("com.mca.portal.PagePassword.On KeyPressed()");
switch (e.getKeyCode())
{
case HKeyEvent.VK_UP:
this.requestFocus();
break;
case HKeyEvent.VK_0: SetInput('0'); return;
case HKeyEvent.VK_1: SetInput('1'); return;
case HKeyEvent.VK_2: SetInput('2'); return;
case HKeyEvent.VK_3: SetInput('3'); return;
case HKeyEvent.VK_4: SetInput('4'); return;
case HKeyEvent.VK_5: SetInput('5'); return;
case HKeyEvent.VK_6: SetInput('6'); return;
case HKeyEvent.VK_7: SetInput('7'); return;
case HKeyEvent.VK_8: SetInput('8'); return;
case HKeyEvent.VK_9: SetInput('9'); return;
case HKeyEvent.VK_ACCEPT:
case HKeyEvent.VK_ENTER:
//if (TestInput()) Application.Run(PortalPage.CreateInstance(_pageNex t));
return;
case HKeyEvent.VK_CANCEL:
case HKeyEvent.VK_ESCAPE:
case HKeyEvent.VK_F9:
Application.Run(PortalPage.CreateInstance(_pageCan cel));
//Application.Run(new PageMainMenu());
return;
}
if (_count == _passcode.length())
{
if (TestInput())
{
//Application.Run(PortalPage.CreateInstance(_pageNex t));
}
}
super.OnKeyPressed(source, e);
}
Thanx
Camzie