0

Often when I am running a program in Eclipse which requires input from the user the text cursor does not move automatically from the code in my Java source file to the console to take user input.

I have to manually click within the console to switch. Often I find myself thinking the cursor has switched automatically when it hasn't and I type my entry for the program into the code instead of the console.

sawreals
  • 338
  • 4
  • 15

1 Answers1

1

There's a feature that can get you part of the way there, but it doesn't satisfy your request 100%. As described here, the Console view has options that will force it to be shown when either System.out or System.err are written to. If you enable one or both of those options (either in the Console toolbar or the global Preferences), then close the Console view, the next time your program writes to System.out the Console will show and take focus (at least on Windows).

The downside is that if Console is already open when your program writes to System.out, then it does not grab keyboard focus.

Community
  • 1
  • 1
E-Riz
  • 31,431
  • 9
  • 97
  • 134