you should give a try with JNA and try mapping native libraries:
- on linux you must map C functions from ncurses library
- on windows you must map functions from both msvcrt and kernel32, as clearly stated here
PS
let me known if you need some sample code