Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Advanced-java] Java Swing question.


  • From: Leonard.Reinstein@xxxxxx (Reinstein, Lenny)
  • Subject: [Advanced-java] Java Swing question.
  • Date: Thu, 21 Mar 2002 14:22:38 -0500

getCaretPosition will still return incorrect value because of newlines.
getCaretPosition works in a text component only, not in a buffer. The
problem is to determine where at any point in time the caret is located in
the text.

-----Original Message-----
From: Tim O'Neil [mailto:toneil@xxxxxxxxxx]
Sent: Thursday, March 21, 2002 2:09 PM
To: 'Advanced-java@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [Advanced-java] Java Swing question.


You need to copy the text into a buffer, a String object or
a byte array, or something. The user only sees the textbox,
the magic is happening on the buffer. Simple.

From: Reinstein, Lenny [mailto:Leonard.Reinstein@xxxxxx]
>This is OK, but how can I make that token invisible? All this has to be
>hidden from the user. The user can open the text component with some
content
>already there. He clicks somewhere in the middle of the text and tries to
>paste some text in it. I handle paste manually. So, I need to know where he
>has the Caret, including newlines. Say, I replace newlines with some tokens
>before I load the content, but the user should not see then. He/she should
>see paragraphs, as though the newlines are there. I am OK with any solution
>as long as it works and can be appplied here. Many thanks in advance.

It took 100 monkeys 100 years to come up with:


***********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
***********************************************************************
_______________________________________________
Advanced-java mailing list
Advanced-java@xxxxxxxxxxxxxxxxxxxxxx
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java