Solved

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

Posted on 2012-03-14
8
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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