Solved

set the horizontal position where text will be added in JTextarea?

Posted on 2012-03-14
8
209 Views
Last Modified: 2012-06-27
Hi,

Is there a way to set the horizontal position where text will be added in JTextarea?

I have:
First, Middle, Last name and then Company name.
Ex.
Jay F. Bar                                 Some Company
Ron  G.  McDonald               Some Other Company

I can't get the company names to line up using "\t" - can I set the insertion point for the company name to some line position?

Thanks
0
Comment
Question by:taborrg
  • 4
  • 4
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 37719216
Save yourself a lot of hassle (you can only do what you're attempting by using an ugly monospaced font anyway) by using a JTable
0
 
LVL 1

Author Comment

by:taborrg
ID: 37719232
Can a JTable be added to a JScrollPane?
0
 
LVL 1

Author Comment

by:taborrg
ID: 37719264
How would that be done with a monospaced font?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37719273
Can a JTable be added to a JScrollPane?

Yes. It almost always is actually
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:taborrg
ID: 37719294
How about in the JTextarea with a monospaced font?  I actually like Couriernew.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 37719322
Well in that case just append each line using String.format
0
 
LVL 1

Author Closing Comment

by:taborrg
ID: 37719328
Looks good,

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37719330
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now