Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How would I go about achieving the effect of JTextArea with JLabel?

I want the output to be displayed every time the button is clicked on the next line down instead of replacing what text is already there, i.e. like an append method for JLabel?

I just want it to follow the same behavior as JTextArea.append.

Also I want to add hyperlink to each line.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
241 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can do that as follows,

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

on each event.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...