Solved

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

Posted on 2012-03-14
8
219 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 86

Expert Comment

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

Yes. It almost always is actually
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert from xls to xlsx using java 7 55
jboss 7.1 start up error 1 33
running on tomcat not jboss eap 7.0 3 18
Tagging and Merging on Branch 1 29
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 last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

856 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