You must know a bit of basic String
format:
So your code will be like:
String myLabel =
// 4
label.getText() + "
" +
// 7:00
(String)boxTimes.getSelectedItem() + " " +
// - Going out....
"- " + input;
label.setText(myLabel);
But as long as JLabel
does not accept
as Abishek Manoharan pointed, you must use <br>
.
String myLabel =
"<html>" +
label.getText() +
"<br/><br/>" +
(String)boxTimes.getSelectedItem() + " - " + input +
"</html>;
label.setText(myLabel);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…