• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use the MediaTracker only in a Frame?  RSS feed

 
Smilidon Sapiens
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to use the MediaTracker in a class SpriteData. This class don't extends a frame or a panel. I want to have all images that belongs to this sprite in its class. But there is no constructor for the MediaTracker, I always must use MediaTracker(this). But if I do it I get an error, because the class is no panel or frame.
Can you help me please?
Thanks!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add a static Component c to your SpriteData class and call new MediaTracker( c ).

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!