Java Swing: Drawing curved lines

前端 未结 2 2024
不思量自难忘°
不思量自难忘° 2021-01-12 19:30

I\'m trying to draw curved lines in Java. A simple bezier curve with an (X,Y) start, an (X,Y) end, and a curve amount would suffice.

I can\'t find a way to do this i

2条回答
  •  悲哀的现实
    2021-01-12 20:23

    Better would be read and following basic tutorial about Graphics2D, tons examples are here,

    • some of examples are outdated by using wrong method paint() instead of correct method for painting for Swing JComponent paintComponent(),

    • simple change wrong method paint() to the paintComponent(),

提交回复
热议问题