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

  • SEARCH
  • Home
  • 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 3809472
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:18:38+00:00 2026-05-19T15:18:38+00:00

The thing I would want to do is that when the user copies a

  • 0

The thing I would want to do is that when the user copies a text in any program (firefox, notepad, pdfReader etc.) my already running java application shall be informed and immediately shows a popup.

I think in order to be able to do this my java application should be invoked whenever system clipboard is changes.

Is that possible with java, if so in which version? I know we can reach and manipulate system clipboard content but my specific question is about invoking the java app. when clipboard content changes.

Thanks

  • 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-05-19T15:18:39+00:00Added an answer on May 19, 2026 at 3:18 pm

    I would have naively pretended it’s a job for JDIC, but the interwebz told me the truth. So, let me explain a little.

    using Toolkit.getSystemClipboard(), you can get access to the native system clipboard. Like any Java object, this clipboard can be listened. Precisely, you can call Clipboard.addFlavorListener(...) to listen to FlavorEvents. What are they ? They’re the metal kings ! …. no no no, I completely and utterly digress. Let me come back. So, a FlavorEvent, according to the doc, indicates that

    that available DataFlavors have changed in the Clipboard (the event source).

    Which may means that Clipboard content has changed. However, I would not go directly on it without a first prototype.

    EDIT Example of a prototype from the fingers of AlexR

    import java.awt.Toolkit;
    import java.awt.datatransfer.FlavorEvent;
    import java.awt.datatransfer.FlavorListener;
    
    public class Main {
        public static void main(String[] args) throws Exception { 
            Toolkit.getDefaultToolkit().getSystemClipboard().addFlavorListener(new FlavorListener() { 
                @Override 
                public void flavorsChanged(FlavorEvent e) { 
                    System.out.println("changed!!! " + e.getSource() + " " + e.toString()); 
                } 
            }); 
            Thread.sleep(100000L); 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started using Masterpages, the thing is I would like to add text
I would have thought that this would be an easy thing to do, but
Actually, almost exactly the same thing. A matrix of small views that would expand
I wrote a function that copies the /etc/skel directory on a linux machine during
If I would want to create a c# application that support multiple languages, how
I have a table view that displays a list that I want the user
I am trying to create a winForms user control. But I want would like
I want to embed a flash to my site, that allows the user to
I am writing website and i`d like to implement profile managment. Basic thing would
If there were such a thing I would imagine the syntax to be something

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.