Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Copying JTable's data to clipboard in Unix/Linux

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have written some code to copy rows selected from a JTable via mouse and copied via Ctrl + C. These rows and their columns are formatted to a string and copied to the system clipboard.

This code works fine in windows. I am able to paste the data from clipboard to notepad.

However this code doesn't work well with linux. Although the System.out.println() statements tell that the data is copied to the system clipboard, but trying to do a Ctrl+V or shift+insert doesn't seem to paste the data.

Has anyone ever tried to paste data to unix/linux's clipboard via java? Any help in this regard will be very much appreciated.

Following is the code that I wrote:

 
Sheriff
Posts: 21971
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Use Code Tags.
 
prav semilo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was able to copy the data to linux. I was trying to paste in the command window itself which is not possible. So I paste my test in firefox address bar(just to test my code) and I was able to paste it.

But now I have another problem. I will be accessing this applet via xterm on a windows machine(client machine, the original linux machine is the server) and I want to be able to copy this data to windows clipboard.

Has anyone ever tried to copy data from remote machines to client machine's clipboard? Any alternative strategies will also be appreciated.
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic