0

I want when the user enter your number number for example write in the position x=55 y=45

  • What are you trying to achieve ? – AllTooSir Jun 17 '13 at 06:08
  • im beginner in java program and now i start learn java i see the reference book in java such as deitel and i dont see any answer because in c# be console.clear(); for clear console and i want that code can do the same action in java – majid khorramgah Jun 17 '13 at 06:15
  • By the way, that's not how Java works. Note that the console handled by C#/.net is directly the Windows console, while Java uses InputStream to communicate with the console, thus not having all the *powers* you have on .Net. – Luiggi Mendoza Jun 17 '13 at 06:21
  • my code is package javaapplication16; import static java.lang.System.*; import java.util.Scanner; public class JavaApplication16 { public static void main(String[] args){ Scanner input=new Scanner (in); int a,b,c; out.print("Please Enter Your First number : "); a = input.nextInt(); // I want the console clear here out.print("PLease Enter Your Second Number : "); b = input.nextInt(); c = a + b; out.printf("Sum is %d",c); – majid khorramgah Jun 17 '13 at 06:32

1 Answers1

0

This post has the same Q and answer

Theres a class called ROBOT in java which controls the peripherals of the pc, check it out .

Link to ROBOT class

Tutorial on mouse moving using ROBOT

the main code from the tutorial above :

import java.awt.Robot;
public class MouseClass {
 public static void main(String[] args) throws Exception {
Robot robot = new Robot();
 // SET THE MOUSE X Y POSITION
 robot.mouseMove(300, 550);
}
Community
  • 1
  • 1
dbkoren
  • 1,305
  • 1
  • 11
  • 16