Results 1 to 3 of 3
- 12-10-2012, 04:07 AM #1Member
- Join Date
- Dec 2012
- Rep Power
New Coder here. Trying to output string to a text box
I'm finishing my first course in programming, so this is more advanced that I can handle.
I coded a simple program to take the input string generated by a barcode scanner to extract a few digits and modify them to a new string.
What I'd like to do is output the string, not to a file or the console, but to a text box in another executable already running; though this is too advanced for me right now.
Is this possible to do?
Here is my code:
public static void main(String args)
String barc0de, step1;
step1 = "1.2";
Scanner kb = new Scanner(System.in);
System.out.println("Scan your barcode now:");
barc0de = kb.nextLine();
char bcArray = barc0de.toCharArray();
step1 = step1 + bcArray + bcArray + bcArray;
Last edited by lenlen006; 12-10-2012 at 04:09 AM.
- 12-10-2012, 05:35 PM #2
- 12-10-2012, 06:06 PM #3
Re: New Coder here. Trying to output string to a text box
It is possible - but it's pretty hacky. You can use Java's Robot class to select your other window and type the code into the box. Some operating systems have scriptable UIs (like applescript) and that could help if you are using a mac. Otherwise, the Robot class is all I can think of.
- By nvts in forum Jobs OfferedReplies: 0Last Post: 05-03-2010, 11:49 PM
- By Kryptix in forum Jobs OfferedReplies: 1Last Post: 10-31-2009, 03:47 AM
- By asse in forum Jobs OfferedReplies: 2Last Post: 08-11-2009, 03:47 PM
- By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM