<AWT Dev> Focus regression in Java8 caused by JDK-7160604

Clemens Eisserer linuxhippy at gmail.com
Wed Nov 5 18:46:31 UTC 2014


Hi Anton,

> I can't say exactly how the fix for JDK-7160604 could change the behavior
> like you described (this requires some more time to investigate).
> However, an obvious question comes to my mind - why don't you make your
> popup non-focusable?
> But still, making the popup simply non-focusable looks
> better.

Exactly, this is the solution I chose to fix the issue.
However, as JDK-7160604 broke an application which was working fine
since Java-1.3 days I thought reporting it wouldn't harm.
Should I open a bug-report? If so, in the jira bug-tracker or using
the "official" form?

> Also, just a side note. As a straightforward workaround to the focus issue,
> you could invoke your requestFocus later, either via calling invokeLater()

Funny thing is, I've tried this approach first - and it leads to a
very strange phenomenon and breaks in a very odd way.
When I call requestFocus inside a runnable executed via
SwingUtilities.invokeLater(), the JTextField doesn't receive any
keyboard events, even after the JPopup is closed and I click on the
JTextField again. This also seems to be a side-effect of JDK-7160604,
before it this also just works.

Best regards, Clemens


More information about the awt-dev mailing list