Reputation: 22200
Referring to my earlier question:
Based on your valuable answers, I choose Java 2D library to cater my requirements.
I completely read the above said library and have full understanding of dealing with the graphics stuff, like what to draw and how to draw etc.Now i only left with one question that how do i draw my required shapes inside JPanel and after drawing all those shapes how do i place that JPanel inside a JScrollPane?
Upvotes: 2
Views: 1077
Reputation: 57421
Override paintComponent(Graphics g)
method.
Cast Graphics
to Graphics2D
and use drawShape()
method passing all your Shapes
Upvotes: 3
Reputation: 15729
You will typically draw your stuff inside a subclass of JComponent, say, MyComponent.
MyComponent myc = new
MyComponent();
JScrollPane jsp =
new JScrollPane(myComponent);
Upvotes: 3