Vous devez être membre et vous identifier pour publier un article.
Les visiteurs peuvent toutefois commenter chaque article par une réponse.
Swing, effet à la fermeture de l’application
Article publié le 17/08/2009 12:23:56Attention la méthode Window.setAlpha(float) nécessite le JDK7.
Code Java (17 lignes)
int fadeOutDuration) { Timeline dispose = new Timeline(window); dispose.addPropertyToInterpolate("opacity", 1.0f, 0.0f); dispose.addCallback(new UIThreadTimelineCallbackAdapter() { public void onTimelineStateChanged(TimelineState oldState, TimelineState newState, float durationFraction, float timelinePosition) { if (newState == TimelineState.DONE) { window.dispose(); } } }); dispose.setDuration(fadeOutDuration); dispose.play(); }
Au lieu d’appeler Window.dispose(), il faudra appeler la méthode fadeOutAndDispose() (par exemple avec un override de public void dispose() en n’oubliant pas à la fin de faire un super.dispose(); )
Un article de nTecH
Source : www.pushing-pixels.org
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 13/09/2004, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/ast-rf-449.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.