How to control another program in your own java written program? - java

I wanted to ask you somewhat simple question in Java lang using Eclipse, as I learned C# language about 2 years, about a couple days I started directly learning this language (Java), now all I am doing is writing a simple programs, like the one I am working on at this minute, it's like a master password program that takes your ID and password for facebook and gmail and hotmail , and then promopts you to type your own short simple name and password which will save your time and make it easier for you to log into any log-in required site, therefore avoiding the Key-loggers (Spyware)....
I wrote my program that runs another program like Messenger, I'm now almost done, all I need how can I give commands or pass String variables to the textboxes in the windows of the msn messenger program, this is the line I tried to pass variables like the input ID goes to the Username textbox in the messenger, and also the same for pass input...
Things I wish You tell me also: how do i make a saved file that will not repeat the first inputs like your original password, i mean that the next use will take you just to type your ID and master pass, and also how do i control the programs with more than pasting a strings.

Use java.awt.Robot to find the MSN Messenger window and type into.

Related

is it possible to write words on other pages like google search box from java programs

I saw a macro program that writes words on anywhere when user click a key on keyboard.(write words that user typed in advance)
But when I study programing i learned just printing out on console or my project like use "system.out"or "setText/print"
problem
I just tried to get curser focus and write words but i can't go forward.
Is it possible to write something from java project to another programs??
I'm not sure whether I understood your question correctly, but you can 'inject' user inputs with the AWT Robot API:
https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html
Here's an example you can take a look at.

Filter character of console input in Java

I'm writing a terminal version of my Java application, and this is the first time I do this. I tried Scanner and Console, but as far as I investigated, these classes only allow me to receive user input after he/she finish inputting (no manipulating/filtering).
For example, I want the user inputs his age, but if he inputs a meaningless string, all I can do is validating the string and requesting him to input again. What I really want is only allow him to input integer, i.e when he press any key which is not a number, the character will not be displayed on console. Using Swing and JTextField I can do this easily with DocumentFilter, but with console only, I still haven't found a way.
Any help is appreciated. Thanks all.
Java has something called robot API which u can use to control keyboard mouse etc...
Not the recommended way :)
Since the console is not Java program (its a c program) you have limited way to interface with it, perhaps you can write native API to get more control over it. I have not tried it but if needed use this option.

Asterisk:- How to achieve Autodialling in Asterisk box in context with java

I have a web app, which connects user to asterisk box via SIP and allow user to call any mobile or landlines number, Now I want to make it automatic, in current scenario User have to manually click on a html button called Dial to dial a number,
Now what I want to achieve is "as soon as user logged in, Asterisk will automatically call 3 nos from the campaign list which is allocated to the user and gives the user call only when the client connected to it. That means caller will be given the call only when receiver receives it.
Any configuration or java code will help, even any algorithm will help also, i know my English is poor so, sorry for any mistakes, I hope people will understand what I am trying to achieve from the above para.
I higly recomend you use dialler code. becuase there are much more issues you never thought about.
http://www.vicidial.org
or other.
If you still think you are qualified enought to write your own code, you can read this page:
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out

Input in Java without pressing enter

I want to take any input in Java without pressing the enter key. Actually I want to make a password input program, so that as soon as the user enter any character, I can clear the screen and replace the characters with an equal number of asterisks ("*"), like the typical password entries made anywhere in the web. Most importantly, I would like to do the same in the Java Terminal Window, not by using those applet methods. Please tell me if i would have to supply more details. I am using BlueJ.
Thank you,
Mayank.
You may want to have a look at the Console's readPassword(...) methods (needs Java 6+).
Or, when using Java 5 (or less), have a look at this article: Password Masking in the Java Programming Language, especially the paragraph Command-Line Input Masking.

Limiting/controlling the users ability to print in Java

I am looking to right an application that limits the number of times a user can print something, its there anything in Java that will allow me to control the printing dialogue to this aim?
Im going to look into these:
http://www.wildcrest.com/Software/J2PrinterWorks/documentation/J2Printer14.html
http://www.softframeworks.com/products/products.php
This is probably something you'll need to implement yourself as it is too-specific a requirement to have been included in the JDK's API.
Assuming you've developed a standalone Swing application you could consider using the Preferences class to store the number of times a user has printed a document for a given date. On Windows this translates to storing information in the registry and is therefore "hidden" from the user to a certain extent, but would allow you to reset the value in an emergency using regedit.
The advantage of this approach is that the user cannot circumvent the print-threshold by simply restarting the application.
I decided to go with J2Printer. I allows the suppression of the print dialogue.

Categories

Resources