• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the swing of canvas ?

 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello!
i want to draw image, so i use canvas, but canvas in the awt package so it is heavyweight comp? is there a lightweight comp. as canvas in swing package?
thanks !
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Canvas is an AWT component and should not be used in SWING.
Use a JPanel and override the paint() or paintComponent() method to draw your image.
 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you !!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!