use [man]nl2br[/man] to convert new lines (/r or /r/n) to html breaks (<BR>).
like this;
$textdata = nl2br($textdata);
adding BB style tags into the text box is Javascript/DHTML i think. if you have a textbox
<TEXTAREA ID="contentbox"...
and a button or image, you need to set the onclick item so that it adds the relevant text to the textarea value.
ONCLICK="contentbox.value = contentbox.value + '[BOLD][/BOLD]';"
i think! note, you can only add to the source anywhere, not just at the end; but it is not possible to add where the cursor is, as when you click the button you remove focus (and therefore the cursor) from the textarea.
bit rusty on JSP/DHTML, so you'll have to do some work to make it work
adam