JAVA Printing

Hello,
Is there any way to print something from the code and have it display to the user?
Tired System.out.print(); and didn’t see anything come up.
Thanks in advance :slight_smile:

public void output(String text){
System.out.println(text);
}

That prints to the Net Beans console, useful for debugging, not so useful in competition though. Does any one know how to print to the Drive Station console?

printing to the driver station you only have 7 lines or so, and you have to replace previous lines. So utilizing it for debugging is a little difficult.

it doesnt work like a typical printf where you can keep going.

To output text to the Driver Station, you must create a DriverStationLCD object. Once it has been initialized, lines can be outputted using:

[DriverStationLCD object name].println(DriverStationLCD.Line.[line],
    [Priority], [message]);

You will also need to use a .updateLCD() command to get it to write to the Driver’s Station.

Ah, yes that worked. For some reason I got a null pointer exception when I tried that before. It worked now though. Thanks!