Example usage for java.awt.datatransfer FlavorEvent getSource

List of usage examples for java.awt.datatransfer FlavorEvent getSource

Introduction

In this page you can find the example usage for java.awt.datatransfer FlavorEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:ja.lingo.application.gui.actions.PasteAndTranslateAction.java

public PasteAndTranslateAction(Model model) {
    this.model = model;

    Toolkit.getDefaultToolkit().getSystemClipboard().addFlavorListener(new FlavorListener() {
        public void flavorsChanged(FlavorEvent e) {
            setEnabled(((Clipboard) e.getSource()).isDataFlavorAvailable(DataFlavor.stringFlavor));
        }/*from  ww w  .  jav  a 2s .  c o m*/
    });
}