How to output a String on multiple lines using Graphics

后端 未结 5 2034
清酒与你
清酒与你 2020-12-28 09:39

My Program overrides public void paint(Graphics g, int x, int y); in order to draw some stings using g.drawString(someString, x+10, y+30);

5条回答
  •  遥遥无期
    2020-12-28 10:23

    You can use a JLabel and embed the text with html.

    JLabel.setText(""+line1+"
    "+line2);

提交回复
热议问题