Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hi please help with conversion from awt to swing

 
sakshi saw
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have an application in awt
which i need to convert to swing

i have a Canvas on which lines are to be drawn so which swing component do you guide

is it JPanel and what should i use for drawing lines which graphics class

please reply soon

 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sakshi saw wrote:hi
i have an application in awt
which i need to convert to swing

i have a Canvas on which lines are to be drawn so which swing component do you guide

is it JPanel and what should i use for drawing lines which graphics class

You should override the paintComponent method:


please reply soon

http://faq.javaranch.com/java/EaseUp
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use a JPanel, and do your graphics in an overridden paintComponent()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic