Displaying dialog during module restore causes java.lang.IllegalStateException: no splash screen available
Martin Barnáš <[email protected]> Mon, 16 Oct 2017 13:52:03 +0000
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <AM5PR0601MB23084AF5003520EF312E5D40E84F0@AM5PR0601MB2308.eurprd06.prod.outlook.com> |
--_000_AM5PR0601MB23084AF5003520EF312E5D40E84F0AM5PR0601MB2308_
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Hi all,
I have application built on top of Netbeans Platform and I need to do some =
checks during loading of one of the modules and display a dialog if some of=
the check fails to let the user to decide what should happen.
Inspired by this tutorial https://platform.netbeans.org/tutorials/60/nbm-lo=
gin.html I created installer for the module and put the checks and dialog d=
isplay to the installers method restore().
NetBeans NetBeans Platform Login Tutorial<https://platform.netbeans.org/tut=
orials/60/nbm-login.html>
platform.netbeans.org
NetBeans Platform Login Tutorial. This tutorial demonstrates how to create =
a login form for a NetBeans Platform application with very simple user and =
password management.
public class Installer extends ModuleInstall {
@Override
public void restored() {
if (check()) {
DialogDisplayer.getDefault().notify(myDialogDescriptor);
//...
}
}
This works but causes the splash screen to be closed and later there occurs=
an exception
java.lang.IllegalStateException: no splash screen available
at java.awt.SplashScreen.checkVisible(SplashScreen.java:197)
at java.awt.SplashScreen.update(SplashScreen.java:324)
at org.netbeans.core.startup.Splash$SplashPainter.repaint(Splash.java:401)
at org.netbeans.core.startup.Splash$SplashPainter$1.run(Splash.java:442)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPriv=
ilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.=
java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.jav=
a:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.=
java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
What can I do to prevent this exception?
Thanks
Martin
--_000_AM5PR0601MB23084AF5003520EF312E5D40E84F0AM5PR0601MB2308_
Content-Type: text/html; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
2">
<style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi=
n-bottom:0;} --></style>
</head>
<body dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font=
-family:Calibri,Helvetica,sans-serif;" dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size: 12pt; color: rgb(0, 0,=
0); font-family: Calibri,Helvetica,sans-serif,"EmojiFont","=
Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Seg=
oe UI Symbol","Android Emoji",EmojiSymbols;" dir=3D"ltr">
<div class=3D"vote"><span itemprop=3D"upvoteCount" class=3D"vote-count-post=
">Hi all,<br>
</span></div>
<div>
<div class=3D"post-text" itemprop=3D"text">
<p>I have application built on top of Netbeans Platform and I need to do so=
me checks during loading of one of the modules and display a dialog if some=
of the check fails to let the user to decide what should happen.</p>
<p>Inspired by this tutorial <a href=3D"https://platform.netbeans.org/tutor=
ials/60/nbm-login.html" rel=3D"nofollow noreferrer" id=3D"LPlnk428140" prev=
iewremoved=3D"true">
https://platform.netbeans.org/tutorials/60/nbm-login.html</a> I created ins=
taller for the module and put the checks and dialog display to the installe=
rs method
<code>restore()</code>. </p>
<div id=3D"LPBorder_GT_15081619166690.7907971362758254" style=3D"margin-bot=
tom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id=3D"LPContainer_15081619166600.26833446055990395" style=3D"width: =
90%; background-color: rgb(255, 255, 255); position: relative; overflow: au=
to; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: =
1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200)=
;" role=3D"presentation" cellspacing=3D"0">
<tbody>
<tr style=3D"border-spacing: 0px;" valign=3D"top">
<td id=3D"TextCell_15081619166630.9391906904566244" style=3D"vertical-align=
: top; position: relative; padding: 0px; display: table-cell;" colspan=3D"2=
">
<div id=3D"LPRemovePreviewContainer_15081619166630.20597966394697909"></div=
>
<div id=3D"LPTitle_15081619166630.7902122015153895" style=3D"top: 0px; colo=
r: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "=
wf_segoe-ui_light","Segoe UI Light","Segoe WP Light&quo=
t;,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-=
height: 21px;">
<a id=3D"LPUrlAnchor_15081619166650.1844933724819391" style=3D"text-decorat=
ion: none;" href=3D"https://platform.netbeans.org/tutorials/60/nbm-login.ht=
ml" target=3D"_blank">NetBeans NetBeans Platform Login Tutorial</a></div>
<div id=3D"LPMetadata_15081619166660.9981489095626906" style=3D"margin: 10p=
x 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "=
;wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,=
Arial,sans-serif; font-size: 14px; line-height: 14px;">
platform.netbeans.org</div>
<div id=3D"LPDescription_15081619166680.2284773746941321" style=3D"display:=
block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_=
segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Aria=
l,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overfl=
ow: hidden;">
NetBeans Platform Login Tutorial. This tutorial demonstrates how to create =
a login form for a NetBeans Platform application with very simple user and =
password management.</div>
</td>
</tr>
</tbody>
</table>
</div>
<pre><code>public class Installer extends ModuleInstall {=0A=
=0A=
@Override=0A=
public void restored() {=0A=
if (check()) {=0A=
DialogDisplayer.getDefault().notify(myDialogDescriptor);=0A=
//...=0A=
}=0A=
}=0A=
</code></pre>
<p>This works but causes the splash screen to be closed and later there occ=
urs an exception</p>
<pre><code>java.lang.IllegalStateException: no splash screen available=0A=
at java.awt.SplashScreen.checkVisible(SplashScreen.java:197)=0A=
at java.awt.SplashScreen.update(SplashScreen.java:324)=0A=
at org.netbeans.core.startup.Splash$SplashPainter.repaint(Splash.java:401)=
=0A=
at org.netbeans.core.startup.Splash$SplashPainter$1.run(Splash.java:442)=0A=
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)=0A=
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)=0A=
at java.awt.EventQueue.access$500(EventQueue.java:97)=0A=
at java.awt.EventQueue$3.run(EventQueue.java:709)=0A=
at java.awt.EventQueue$3.run(EventQueue.java:703)=0A=
at java.security.AccessController.doPrivileged(Native Method)=0A=
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPriv=
ilege(ProtectionDomain.java:80)=0A=
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)=0A=
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.=
java:201)=0A=
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.jav=
a:116)=0A=
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.=
java:105)=0A=
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)=0A=
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)=0A=
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)=0A=
</code></pre>
<p>What can I do to prevent this exception?</p>
</div>
</div>
Thanks</div>
<div style=3D"font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri,He=
lvetica,sans-serif,"EmojiFont","Apple Color Emoji",&quo=
t;Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","And=
roid Emoji",EmojiSymbols;" dir=3D"ltr">
Martin<br>
<p></p>
</div>
</div>
</body>
</html>
--_000_AM5PR0601MB23084AF5003520EF312E5D40E84F0AM5PR0601MB2308_--