Results 1 to 3 of 3
- 01-29-2012, 04:23 AM #1
Senior Member
- Join Date
- Feb 2011
- Posts
- 235
- Rep Power
- 3
running through jlabel fade only once
how would i make this text fade out only once?
Java Code:public void fadeJlabelText() { new Timer(50, new ActionListener() { public void actionPerformed(ActionEvent e) { alpha += increment; if (alpha >= 200) { alpha = 200; increment = -increment; } if (alpha <= 0) { alpha = 0; increment = -increment; } label.setForeground(new Color(0, 0, 0, alpha)); } }).start(); }Last edited by droidus; 01-29-2012 at 03:14 PM.
- 01-29-2012, 02:05 PM #2
Re: running through jlabel fade only once
Use a boolean variable to control its execution. If the variable is not set, do the code and set the variable.only once
- 01-29-2012, 02:15 PM #3
Similar Threads
-
Problem running Applet in IE but works when running just Java in Netbeans?
By rodneyc8063 in forum Java AppletsReplies: 7Last Post: 12-18-2011, 04:13 AM -
Fade in/Fade out Class for any object
By eLancaster in forum New To JavaReplies: 3Last Post: 04-13-2011, 03:19 PM -
Adding a JLabel to a JPanel - jlabel not showing
By Bongeh in forum New To JavaReplies: 17Last Post: 04-06-2010, 11:02 PM -
Problem in running Java swing wizard in jre 1.6 while it is running in jre 1.4
By Sanjay Dwivedi in forum AWT / SwingReplies: 0Last Post: 08-26-2009, 01:03 PM -
Alpha Fade Flicker
By jamesfrize in forum Java AppletsReplies: 3Last Post: 04-02-2008, 02:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks