on 08-28-2007 3:41 PM
Hello!
I'm developing a mobile AWT application and I need a keylistener. When I'm testing the app as a Java app the keylistener is working well, but in the mobile infrastructure and at the PDA it doesn't work. any ideas?
I've solved the problem! The panel didn't get the focus and so the keylistener didn't work!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi jo!
i'm using jdk1.3.1
here a code example:
public class PrintingMenuPanel extends BUBPanel implements KeyListener {
public PrintingMenuPanel() {
addKeyListener(this);
Panel container = new Panel();
container.setLayout(new GridLayout(2,1,3,3));
container.add(new Button("1 - Aus Fertingsaufgrag", this, "1"));
container.add(new Button("2 - Aus Bestellung", this, "2"));
setLayout(new BorderLayout());
add(container, BorderLayout.NORTH);
}
public void actionPerformed(ActionEvent ae) {
if(ae.getActionCommand().equalsIgnoreCase("1"))
getRootPanel().showPrintingContractMenuPanel();
if(ae.getActionCommand().equalsIgnoreCase("2"))
getRootPanel().showPrintingOrderMenuPanel();
}
public void keyPressed(KeyEvent e) {
System.out.println(e.toString());
}
public void keyReleased(KeyEvent e) {
System.out.println(e.toString());
}
public void keyTyped(KeyEvent e) {
System.out.println(e.toString());
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi markus,
which version of jdk are you using?
can you post your keylistener implementation?
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.