OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Java App Freezes When Using Textfield
totsubo
post Apr 7 2005, 06:39 PM
Post #1





Group: Members
Posts: 60
Joined: 12-February 05
Member No.: 6,461



Long story short, I wrote a Java app thet works fine on my desktop, and works fine on my Zaurus 3000 until it hits KeyAdapter code for a TextField.

Specifically it freezes when I try to access the TextField in the adapter.

I know that it's not the TextFiled nor the adapter per se but the combination of accessing the TextField from inside it's adapter. I can use the TextField other palces in the code fine, and if I remove the use of the TextField from the adapter code everything works fine.

It's only my adapter tries to use the TextField my app freezes. The relevant code looks like this:

[...]
answerTF.addKeyListener(new KeyPressed());
[...]

private class KeyPressed extends KeyAdapter {
public void keyPressed(java.awt.event.KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
/* the line below causes app to freeze */
System.out.println("Entry is: " + answerTF.getText());
}
}
}

Any ideas?
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th December 2014 - 10:06 PM