Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Append text in JLabel

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.

like image 236
Sachin Mhetre Avatar asked Nov 30 '22 15:11

Sachin Mhetre


1 Answers

You can do that as follows,

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

on each event.

like image 117
Rahul Borkar Avatar answered Dec 10 '22 23:12

Rahul Borkar