We help IT Professionals succeed at work.
Get Started

Cursor Position or Text Position

carlospq
carlospq asked
on
850 Views
Last Modified: 2012-08-14
Hello everybody in Expert.

I have a jList, and when i select one item, i want it to be showed in a JTextField... no problem with that...

The problem is that when the length of text in the Jlist is bigger than the length of the JtextField that is visible, then it shows the end of the text...

I know it is not very clear... maybe i can make it clearer with a diagram:

Imagine this is the Jlist:

-------------------------------------------------
| Text of first item of the List                |
| Text of second item of the List           |
| Another text of an item of the List     |
| Text of 4 item of the List                    |
|                                                           |
-------------------------------------------------

And this is the JtextField:

----------------------
|                          |
----------------------

Then when i make a click on one item (for example the second), i show it on the JtextField. But it appears like this:

----------------------
|d item of the List|
----------------------

Instead of like i would like to: (i would like to see the first part)

----------------------
|Text of second it|
----------------------

Anybody could help me??

Thank you a lot.

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE