SunToolkit.java is trying to post an event on the TrayIcon appContext, but the TrayIcon was already removed by the test, causing an error. The fix is to make SunToolkit skip posting the event if appContext is null. The test is also updated to remove applet usage and use PassFailJFrame instead.
------------- Commit messages: - removed applet usage in test, fixed event posted on wrong app context bug Changes: https://git.openjdk.org/jdk/pull/17329/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17329&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8316931 Stats: 274 lines in 3 files changed: 36 ins; 206 del; 32 mod Patch: https://git.openjdk.org/jdk/pull/17329.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17329/head:pull/17329 PR: https://git.openjdk.org/jdk/pull/17329