Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes How do I take a variable and print it to a cursor using SWT? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do I take a variable and print it to a cursor using SWT?" Watch "How do I take a variable and print it to a cursor using SWT?" New topic
Author

How do I take a variable and print it to a cursor using SWT?

Wc Swanson
Greenhorn

Joined: Feb 09, 2011
Posts: 1
I am rewriting an application in Java from the Processing IDE to Eclipse. In Processing I have been able to get a variable printed to the cursor using the following code:

import processing.serial.*;
import java.awt.*;
import java.awt.event.*;

Robot robot;

try
{ robot = new Robot(); }
catch (Throwable t)
{
t.printStackTrace();
exit(); // If there is an exception here, we might as well exit
}

for (int i=0; i<s.length(); i++)
{
println("keyPress: " + s.charAt(i) + " i: " + i + " :: " + (int)s.charAt(i));
{
robot.delay(90);

}

Does anyone have any sample code using SWT?

The purpose is to take a reading from a serial port and drop the reading at the cursor which could be in a spreadsheet.

Bill>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I take a variable and print it to a cursor using SWT?