Examples of Clipboard


Examples of java.awt.datatransfer.Clipboard

    Clipboard clip = editor.getToolkit().getSystemClipboard();
    clip.setContents(new Data(data), this);
  }
 
  public boolean canPaste() {
    Clipboard clip = editor.getToolkit().getSystemClipboard();
    Transferable xfer = clip.getContents(this);
    return xfer.isDataFlavorSupported(binaryFlavor);
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

    Transferable xfer = clip.getContents(this);
    return xfer.isDataFlavorSupported(binaryFlavor);
  }
 
  public void paste() {
    Clipboard clip = editor.getToolkit().getSystemClipboard();
    Transferable xfer = clip.getContents(this);
    int[] data;
    if (xfer.isDataFlavorSupported(binaryFlavor)) {
      try {
        data = (int[]) xfer.getTransferData(binaryFlavor);
      } catch (UnsupportedFlavorException e) {
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

        }
        buffer.append('\n');
      }
    }
    final StringSelection ss = new StringSelection(buffer.toString());
    final Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
    cb.setContents(ss, ss);

  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

      buf.append(name).append(", ");
    }
    if (buf.length() > 0)
    {
      buf.setLength(buf.length() - 2)// Remove trailing ", ".
      Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
      StringSelection data = new StringSelection(buf.toString());
      clip.setContents(data, data);
    }
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

        buf.append("</tr>\n");
      }
      buf.append("</table>");

            htmlSelection.setData(buf.toString());
            Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
        cb.setContents(htmlSelection, null);
    }
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

   * owner of the Clipboard's contents.
   */
  public void setClipboardContents( String aString )
  {
    StringSelection stringSelection = new StringSelection( aString ) ;
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() ;
    clipboard.setContents( stringSelection, this ) ;
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

   * empty String.
   */
  public String getClipboardContents()
  {
    String result = "" ;
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() ;
    //odd: the Object param of getContents is not currently used
    Transferable contents = clipboard.getContents( null ) ;
    if ( ( contents != null ) &&
        contents.isDataFlavorSupported( DataFlavor.stringFlavor ) )
    {
      try
      {
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

  }
 
 
  void setClipboardContents( String str ){
    StringSelection stringSelection = new StringSelection( str );
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents( stringSelection, this );
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

        sb.append("\t");
      }
      sb.deleteCharAt(sb.length() - 1);
      sb.append("\n");
    }
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    StringSelection stsel = new StringSelection(sb.toString());

    clipboard.setContents(stsel, stsel);
  }
View Full Code Here

Examples of java.awt.datatransfer.Clipboard

        JButton copyButton = new JButton("Copy");
        copyButton.setMnemonic('o');
        copyButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                StringSelection trace = new StringSelection(text.getText());
                Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
                cp.setContents(trace, trace);
            }
        });
        buttonPanel.add(copyButton);
        buttonPanel.add(button);
        dialog.getRootPane().setDefaultButton(button);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.