Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   JAVA Printing (http://www.chiefdelphi.com/forums/showthread.php?t=91477)

Mk.32 11-02-2011 02:17

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 :)

mwtidd 11-02-2011 06:55

Re: JAVA Printing
 
public void output(String text){
System.out.println(text);
}

Ben_R_R 11-02-2011 13:19

Re: JAVA Printing
 
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?

mwtidd 11-02-2011 13:45

Re: JAVA Printing
 
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.

morganfshirley 12-02-2011 13:25

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

Code:

[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.

Ben_R_R 12-02-2011 13:48

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


All times are GMT -5. The time now is 10:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi