canvas vs jpanel pros and cons | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

canvas vs jpanel pros and cons

I heard that I don't should mix awt and swing. Is canvas "old" because it is awt? did canvas have something that jpanel don't have? is canvas better/faster in rendering? jpanel has double Buffering per default how about canvas? and especially what is better for games?

10th May 2019, 1:44 PM
Stefanoo
Stefanoo - avatar
1 Answer
+ 2
JPanel can also do drawing. But they are more for laying out other components. Even you used JPanel to paint you are still depend in awt's paint method (directly or overriden methods) And I don't think that you should not mix awt and swing together. So according to me using canvas is more better
10th May 2019, 2:04 PM
Seniru
Seniru - avatar