|
-
May 9th, 2000, 03:24 PM
#1
Help:: Java's getSystemClipboard() does not work in case of an Applet !!!!???? Is that right ??
I created a class with two text field and two buttons, Copy and Paste. Type some text in the one of the text field and hit Copy I put the text in the clip board by using
Clipboard system = Toolkit.getDefaultToolkit().getSystemClipboard();
String strData = textField1.getText();
stsel = new StringSelection(strData);
system.setContents(stsel,stsel);
Hit Paste button and I reads the data from the Clip board and puts it in another text field. Here is the following code:
try
{
String trstring = (String)(system.getContents(null).getTransferData(DataFlavor.stringFlavor));
TextField2.setText(trstring);
}
This works fine if I attach this class from Application and does not work if the same class is attached to a Applet. WHY !!!! am I doing something wrong !!!??
Can anyone help me, with this stupid thing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|