How to draw a directed arrow line in Java?

后端 未结 5 1735
眼角桃花
眼角桃花 2020-12-01 06:43

I want to draw a directed arrow line through Java.

At present, I am using java.awt.Line2D.Double class to draw a line

g2.setStroke(new B         


        
5条回答
  •  春和景丽
    2020-12-01 07:04

    Just in case if you want an non-programmatic arrow (I.e. for text purpose) in Fast way, you can use code for making arrow as text, just put your HTML code inside .setText() method for a component. I have java 1.8u202 it works fine.

    myLabel.setText("←");

    this code is for left-pointing arrow

    other arrow directions HTML code from This Website

提交回复
热议问题