Public static void main (final String args) Gpanel.add (label = new JLabel ('Animated cursor only appears over this '+ Public void actionPerformed (ActionEvent ae)Īnicursor = new AniCursor (aniName, label) SetDefaultCloseOperation (EXIT_ON_CLOSE) įinal JButton btnStart = new JButton ('Start') Public AniCursorDemo (final String aniName) Public class AniCursorDemo extends JFrame
Listing 1 presentsĪniCursorDemo’s source code. Takes care of animating these images over a label component. It also uses the library to start and stop an animation thread, which ani (animated cursor) file identified via the command
This program uses the library to extract cursor images from a The AniCursorDemo Swing application demonstrates the animated cursor The library is also compilable with J2SE 5.x, and usable on other I built and tested this article’s code with Java SE 6 on a Windows XP