3
3
3ds2011-08-24 12:25:09
Java
3ds, 2011-08-24 12:25:09

java intercept selection

Java question, how to catch an event when the user has selected text with the mouse? Tell me where to dig.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mgarin, 2011-08-26
@mgarin

If you are talking about listening to selection in third-party applications from your Java application, nothing will come of it. At least on pure-java.
Java in its configuration carries (for the most part) only cross-platform functionality.
Therefore, any work with system windows, fields, buttons and other components of other system windows, some tricky “tricks” in the form of progress on the application status bar in Windows 7, etc., is impossible in Java without calling native tools (as these guys , for example). Calling native tools entails possible compatibility problems between different versions of the same OS, problems with code portability (cross-platform), and can also affect the stability of the JVM.
Various similar things are included in the standard "set" only if they appear in all known operating systems (as happened with a certain version of JDK 6 with transparency and window shapes, for example), but this all takes a VERY long time and, as you know, not when you need .
PS You can always use JNI + C code, but this is not the same ...

I
Igor Petrov, 2011-08-24
@KriegeR

The first thing that came to mind was to look at Horstmann. Volume one. Chapter "Event Handling". Perhaps you will find it there.

V
vtysh, 2011-08-24
@vtysh

CaretListener must be used
www.java2s.com/Tutorial/Java/0260__Swing-Event/CaretEventsandListeners.htm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question