Solved

JTextField - change caret side

Posted on 2003-12-06
2
251 Views
Last Modified: 2012-06-21
Im trying to change a JTextField so it writes from right to left, much the same way a spreadsheet or calculator cell works for numerical values. How would I do this?

thanks.
0
Comment
Question by:illucid
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9891631
JTextField rightAlignedTextField = new JTextField(20);

rightAlignedTextField.setHorizontalAlignment(SwingConstants.RIGHT);
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9895027
;-)
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

Suggested Solutions

Title # Comments Views Activity
DO we need Java installed on a Windows PC and WHY ? 13 94
get weblogic logged in user in java 2 57
maven project error 5 44
Basic Java Case or If-Else statement... 3 43
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 …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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.

937 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

10 Experts available now in Live!

Get 1:1 Help Now