maanoo/blog

Monday, October 26, 2015

Java: Set the Clipboard

The easiest way to make the Clipboard contain a string is:

public void setClipboard(String text) {
  Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
  StringSelection selection = new StringSelection(text);
  c.setContents(selection, selection);
}


done_
Posted by Akritas Akritidis at 10:00 AM
Labels: code, java, utils
Newer Post Home

Search

Labels

code techniques utils javascript java html life build make web android c easy makefile windows c++ css enum python bash decline email greek it is known libgdx movie objective php regex review security

Blog Archive

  • ►  2025 (4)
    • ►  May (2)
    • ►  April (2)
  • ►  2024 (5)
    • ►  August (1)
    • ►  June (3)
    • ►  May (1)
  • ►  2023 (3)
    • ►  November (1)
    • ►  September (1)
    • ►  August (1)
  • ►  2022 (3)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
  • ►  2021 (8)
    • ►  September (1)
    • ►  June (3)
    • ►  March (1)
    • ►  February (3)
  • ►  2020 (6)
    • ►  May (1)
    • ►  March (1)
    • ►  February (3)
    • ►  January (1)
  • ►  2019 (4)
    • ►  October (1)
    • ►  August (1)
    • ►  July (1)
    • ►  January (1)
  • ►  2018 (3)
    • ►  November (1)
    • ►  September (1)
    • ►  July (1)
  • ►  2017 (1)
    • ►  May (1)
  • ►  2016 (3)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
  • ▼  2015 (12)
    • ►  November (9)
    • ▼  October (3)
      • Techniques: Generating colors with HSL and HSV/HSB
      • Code: Normalize overflowing values
      • Java: Set the Clipboard

Website

maanoo.com
Copyright © 2015 Akritas Akritidis. Simple theme. Powered by Blogger.