Ok here goes,
I am using a customized list model, this list model uses a customized cell renderer. The object the cell renderer uses is a subclass of a JPanel.
I have an animated gif that I wanted to show, I am able to have the regular gif drawn but not the animated. Any help?
mBuddyIcon is defined as an ImageIcon, is this why it's not animating? I have also defined it as type Image before but the ImageIcon and Image types produce the same image, which is not animated. How do I get this to animate?
BackBuffer and BackDC are for the double buffering.
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;
I am using a customized list model, this list model uses a customized cell renderer. The object the cell renderer uses is a subclass of a JPanel.
I have an animated gif that I wanted to show, I am able to have the regular gif drawn but not the animated. Any help?
mBuddyIcon is defined as an ImageIcon, is this why it's not animating? I have also defined it as type Image before but the ImageIcon and Image types produce the same image, which is not animated. How do I get this to animate?
BackBuffer and BackDC are for the double buffering.
Code:
[blue]
public void paint(Graphics g)
{
BackBuffer = createImage (this.getSize().width, this.getSize().height);
BackDC = BackBuffer.getGraphics ();
int NumOfImgs = (this.getWidth()/mRed.getWidth(null))+1; //RoundUp
for(int i=0;i<NumOfImgs;i++)
{
BackDC.drawImage(mDefault,i*65,0,Color.BLACK,null);
}
BackDC.setFont(listFont);
BackDC.setColor(Color.WHITE);
BackDC.drawString(mName,60,20);
[red]mBuddyIcon.paintIcon(this,BackDC,0,0);
[green]//I have tried this and the following...[/green]
BackDC.drawImage(mBuddyIcon,0,0,Color.BLACK,null) [/red]
[green]//The latter of the two was using an Image and not an image icon[/green]
g.drawImage(BackBuffer,0,0,this);
}
[/blue]
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;