Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

declaration of JTextArea in java - Box containing multiple lines of text separated by '\n'.

ta = new JTextArea(rows, cols); Creates textarea with specifed number of rows and columns.
s = ta.getText(); Returns string in text area.

ta.setText(s); Sets text to s.

ta.append(s); Adds s to end of existing text.


ta.insert(s, pos); Inserts s at position pos.


ta.setEditable(bool); Don't allow user to edit textarea if used for output.


ta.setLineWrap(bool); Allow/disallow long lines to wrap.


ta.setWrapStyleWord(bool); Call setLineWrap(true) first. true wraps at word boundaries, false (default) at characters.


ta.setBorder(brdr); Add space between text and edge. Eg, to add 4 pixels use brdr BorderFactory.createEmptyBorder(4,4,4,4)

No comments:

Post a Comment

Archives