Hi All

I need to capture the whole text from the screen so that I can check that particular text is present in that or not. application is in Java. I am having below code but it is not working as import statements are giving me compilation error.

import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.widgets.Display;

String textFromClipboard = null;
Clipboard clipboard = new Clipboard((Display)display);
TextTransfer textTransfer = TextTransfer.getInstance();
textFromClipboard = (String)clipboard.getContents(textTransfer);
return textFromClipboard;

Please suggest/advice some solution.