How do i align this text correctly?

前端 未结 2 991
失恋的感觉
失恋的感觉 2020-11-29 09:42

I wrote this polar clock today and i am almost finished exept i want to align my text inside the line similar to this. Does anyone know how to do this? Ive tried to use Font

2条回答
  •  天命终不由人
    2020-11-29 10:28

    You have to be able to draw text along the curves. There are several ways to do it, but the simplest one is to use Stroke API. You can find an example at http://www.jhlabs.com/java/java2d/strokes/

    The other way is using affine transforms. The example is at http://www.java2s.com/Code/Java/2D-Graphics-GUI/Drawtextalongacurve.htm

提交回复
热议问题