System.Exit() Hangs after clipboard.

K

Kevin

Hello,


On Linux RedHat 9.0 I am using the Clipboard to cut paste in and out of
my application and all is OK. But after I post anything to the
clipboard I can no longer exit my application. The last command I
execute is System.exit(0) but my window never exits and my application
is hung;
Is there some other cleanup required when I have accessed the system
toolkit?




Thanks

private void addClipboard(){
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
try {
sm.checkSystemClipboardAccess();
}
catch (Exception e) {e.printStackTrace();}
}
Toolkit tk = Toolkit.getDefaultToolkit();
cp = tk.getSystemClipboard();

}
public void lostOwnership(Clipboard clip, Transferable tr) {
System.out.println("Lost Clipboard Ownership?!?");
}
public void toClipboard(StringSelection st) {
if(st !=null){
cp.setContents(st, this);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top