one line in jtextpane

i'm using jtextpane and I add jlabels in it by pressing on certain buttons. Now, i want the jtextpane to act like a jtextfield, so that i only have one row, with no scrollbars, and when it becomes to long, you can scroll in it with the arrow keys from left to right.

I looked at the api but I can't find it

Message was edited by:

nonakresal

[368 byte] By [nonakresala] at [2007-10-3 8:41:16]
# 1

This posting shows how to prevent the text pane from wrapping:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=326017

If you want to prevent the user from inserting a newline character into the text pane then you need to use an empty KeyBinding. Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Key Bindings[/url] for more information.

camickra at 2007-7-15 3:49:33 > top of Java-index,Desktop,Core GUI APIs...