user123456789
user123456789

Reputation: 87

Java how does graphics abstract drawline method really works?

I read source code of Java Graphics abstract class, I am curious how does this abstract void drawline method draws lines in JComponent's paint(Graphics g) and paintComponent(Graphics g). I know that abstract methods have no method body. I couldn't find any relevant examples with Google. If possible, can you provide me a link to source code of this method.

Upvotes: 1

Views: 181

Answers (1)

Joe Vanjik
Joe Vanjik

Reputation: 357

Mad Programmer is right, all of java's graphics and graphics2d methods is directed with native codes. If you're curious about these native codes, open src zip of your JDK go to Java Desktop/sun/java2d/windows/GDIRenderer. You can see some native methods for graphics class.

Upvotes: 1

Related Questions