j***@gmail.com
2014-10-10 23:39:39 UTC
Hi,
I am running NetBeans 8.0.1 on a Mac running Mac OS X. I am trying to
set up a program to read user entry from the keyboard. I use the
following code:
----------------------------------------------
Console con;
...
try {
con = System.console();
if (con != null) {
selection = con.readLine();
}
} catch (Exception ex) {
}
----------------------------------------------
The problem is, even after the step con = System.console();, the
debugger says that con is null. Do I need to set up something on the
Mac itself, or are there problems with the code?
Thanks,
Jim
I am running NetBeans 8.0.1 on a Mac running Mac OS X. I am trying to
set up a program to read user entry from the keyboard. I use the
following code:
----------------------------------------------
Console con;
...
try {
con = System.console();
if (con != null) {
selection = con.readLine();
}
} catch (Exception ex) {
}
----------------------------------------------
The problem is, even after the step con = System.console();, the
debugger says that con is null. Do I need to set up something on the
Mac itself, or are there problems with the code?
Thanks,
Jim