Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Java applet break line in JTextField

Thread view: 
Pedro Pinto - 01 Apr 2007 18:47 GMT
Hi there,

I'm designing an applet that it is now almost funcional. It is a
client version of the program that requests a list of items, displayed
in strings, on an JTextField on the applet. My question is, when i
receive the text it displays everything on the same line, altought the
textfield is bigger than that. My question is, how can i break line on
the strings receive to produce a better output on the applet? Thanks
in advance for any help.

Regards

Pedro Pinto
Mark Space - 01 Apr 2007 19:40 GMT
> Hi there,
>
[quoted text clipped - 5 lines]
> the strings receive to produce a better output on the applet? Thanks
> in advance for any help.

I think the answer is pretty much "no."  JTextField is designed to be a
single line of text entry and changing that would involve some horrible
hacks.  Look at JTextArea if you need multi-line input.
Andrew Thompson - 02 Apr 2007 03:54 GMT
..
>...how can i break line on
>the strings receive to produce a better output on the applet?

Mark was correct that JTextArea would allow line breaks,
but it really seems this applet would do better with a JList
(purpose made for a list of items!).

Signature

Andrew Thompson
http://www.athompson.info/andrew/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.