vertical arrangement within a JLabel

I have been looking through the API's and have not found a solution. Is it possible when clicking a button that will display text into a JLabel to start it on a new line underneath the text displayed from pressing a button before?

also to be able to allign certain words within that line to different points?

[323 byte] By [lozengera] at [2007-11-26 17:42:23]
# 1
Isn't that what a JTextArea is for?
paulcwa at 2007-7-9 0:10:35 > top of Java-index,Java Essentials,New To Java...
# 2
Yes but i dont want to type or edit text. the text is stored with a button when the button is pressed that text is to then appear in a JLabel, JTextArea?, how can i achieve this?
lozengera at 2007-7-9 0:10:35 > top of Java-index,Java Essentials,New To Java...
# 3

I thought that JTextAreas could be configured so they're read-only for the user.

(looking at API docs) yeah there's a setEditable method and a isEdiitable method. Plus there are all sorts of weird stuff you can do by playing with the text area's Document, apparently. Ask on the Swing forum or read the docs.

The docs for JLabel say "short text string" so it's probably not appropriate for multi-line text.

paulcwa at 2007-7-9 0:10:35 > top of Java-index,Java Essentials,New To Java...
# 4
Are you saying that you wish the text area was not editable? [url= http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/JTextComponent.html#setEditable(boolean)]setEditable(false);[/url]
DrLaszloJamfa at 2007-7-9 0:10:35 > top of Java-index,Java Essentials,New To Java...
# 5
[nobr]You could just try this (assuming I understood you correctly):yourLabel.setText(yourLabel.getText() + "<br>New Line!");[/nobr]
CaptainMorgan08a at 2007-7-9 0:10:35 > top of Java-index,Java Essentials,New To Java...