Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8712473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:07:02+00:00 2026-06-13T05:07:02+00:00

Lets say i’m reading PDF file or using web broswer and i hilighted a

  • 0

Lets say i’m reading PDF file or using web broswer and i hilighted a word.

I want a procedure in JAVA , procedure in an independent program , to get that selected text
using my JAVA program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:07:03+00:00Added an answer on June 13, 2026 at 5:07 am

    It sounds as if the other program will be “active” and have focus, and that you are desiring to use Java in the background to capture the selected text, perhaps using a hotkey combination.

    Java may not be the best tool for this sort of behavior. Since Java is built to be as OS-agnostic as possible, it is difficult to do OS-specific tasks with Java. Having said this, this can be done with Java but would involve “stretching” Java and using non-Java code integrated with Java via JNI, JNA, or a OS-specific utility bridge such as AutoIt V3 if this is for a Windows platform. This solution would of course be OS-specific and could not be used in a cross-platform fashion.


    Edit 1
    You state in a comment:

    Thank you .. But how to use JNI OR JNA to do that ?

    @blackgh: and therein lies the rub. You need to first learn JNI (more difficult if you’re not already familiar with C or C++) or JNA (which in my opinion is easier), and then learn to make a keyboard hook if you want to make a hot key. This would take a bit of time and effort to do, but is doable. If this were my project, and I needed to do it quick and it absolutely had to integrate with Java, and if it were for a Windows platform, I’d go with AutoIt V3 or something similar to create a script for the hot key as the easiest solution, and in fact I’ve done something like this, but again you’d need to learn the the AutoIt language (it’s like Basic).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say i created a virtualenv called venv (virtualenv venv) From reading tutorials, i
Lets say I have a .c file with some methods, and I create a
Lets say in a file I have some code in two files part of
Lets say my file lives in the config folder and it's called config/foo.yml .
Lets say I create a custom property called test123 inside of the alfresco-global.properties file.
Lets say I had file on my website on this path www.mysite.com/blah/images/picture.jpg and then
Lets say you're in a file called logging.py. If you try to import the
Lets say that we have a specific string: string a[]={ab,cd,ef} and we want a
Lets say I have several web sites on my web server, all as applications
Lets say I've got two interchangeable pieces of code and I want to figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.