Solved

JTextField - change caret side

Posted on 2003-12-06
2
254 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

810 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