• Post Reply Bookmark Topic Watch Topic
  • New Topic

Which container can be used to load objects?

 
Malcolm Whitely
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I currently have a class that extends Thread and loads some sort of animation. Can anyone recommend a container with size/color attributes which I would be able to add the instance of the class to? I have tried a canvas and a panel but with no luck. I get a "Incompatible Type for method" error every time.
Thanks.
 
Linda Jones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about making your class extend Canvas (or Panel) and implementing the Runnable interface.
Java Tutorial page on Runnable
Linda
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!