Append text in JLabel

。_饼干妹妹 提交于 2019-11-28 12:42:52
  1. Use HTML formatting in the label by starting the text with prefix <html><body> (possibly add some in-line styles in the body opening element).
  2. Add each line, ending with <br> or <p> (or <li> if adding <ul><li> to the prefix).

See also How to Use HTML in Swing Components. For such gems as..

You can do that as follows,

label.setText(label.getText() + "text u want to append");

on each event.

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