Java how does graphics abstract drawline method really works?

旧时模样 提交于 2021-02-17 02:00:35

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/51974770/java-how-does-graphics-abstract-drawline-method-really-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!