Issue Details (XML | Word | Printable)

Key: UMO-65
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: ULC Team
Reporter: Daniel Grob
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ULCMobile

JVM hangs when invoking Component.transferFocus()

Created: 15/Oct/07 10:25 AM   Updated: 15/Oct/07 10:59 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
In the Creme VM transferFocus() actually triggers two round-trips: one for focusLost and one for focusGained whereas with the Sun VM transferFocus8) only triggers one round-trip. As a side-effect of these two round-trips the Creme VM hangs. Reason: when the first round-trip returns ULC Mobile removes the hours glass mouse cursors from a non AWT Thread and at the same time the AWT Thread tries to lock the user interface.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Daniel Grob added a comment - 15/Oct/07 10:59 AM
As a workaround instead of triggering the focus change with transferFocus() you can use the following code construct:
Container topLevelAncestor = getBasicTextComponent().getTopLevelAncestor();
long when = System.currentTimeMillis();

KeyEvent pressedEvent = new KeyEvent(topLevelAncestor, KeyEvent.KEY_PRESSED, when, 0, KeyEvent.VK_TAB, '\t');
KeyEvent releasedEvent = new KeyEvent(topLevelAncestor, KeyEvent.KEY_RELEASED, when, 0, KeyEvent.VK_TAB, '\t');
KeyEvent typedEvent = new KeyEvent(topLevelAncestor, KeyEvent.KEY_TYPED, when, 0, KeyEvent.VK_UNDEFINED, '\t');

Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(pressedEvent);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(releasedEvent);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(typedEvent);