While reading religiously through SO, I've seen many examples of using animated gifs in java via the classic:
JLabel mylabel=new JLabel(new ImageIcon("animated.gif"));
Which works fine but when I add mylabel to a JPanel, I've noticed the JPanel's paintComponent method gets called every time the gif changes frames.
Is that really necessary?
Isn't the gif isolated to the JLabel?
It seems like an expensive waste of time to repaint the whole panel (and whatever other components are added to it) every time a gif cycles frames.
In case you're wondering why I care: From doing web design (js/css), I learnt how to avoid reflows almost entirely and isolate repaints to only the element being changed. Worked wonders for performance.
./means the current directory/package and../means the parent directory, what does.../mean? - Andrew Thompson