PrintWriter class in Eclipse ? Help!
in
Integration and Hardware
•
3 years ago
Hi,
I'm transitioning into Java from Processing, and I'm still trying to familiarize myself with the Eclipse IDE. I followed Shiffman's tutorial on integrating Processing with Eclipse, and also installed an Eclipse plugin which adds the Export to Applet / Application function into Eclipse (forgot who made this plugin but it is damn cool! ).
And I'm trying to write a program which incorporates Ben Fry's "Table" class from his book "Visualizing Data". And there is one line in that "Table" class which refer to a "PrintWriter" class:
Does anyone know what exactly is a "PrintWriter" class? is it part of the core library / its .jar files? and how can I incorporate it into Eclipse (like is there a .jar file that is supposed to be imported and added to build path - like core.jar ) .. and if so, what changes do I need to put in to my source code to use it? (like how to properly define / call it, etc)
Please help, and thanks in advance for taking timie to reply! :)
Cheers,
niM_xaM
I'm transitioning into Java from Processing, and I'm still trying to familiarize myself with the Eclipse IDE. I followed Shiffman's tutorial on integrating Processing with Eclipse, and also installed an Eclipse plugin which adds the Export to Applet / Application function into Eclipse (forgot who made this plugin but it is damn cool! ).
And I'm trying to write a program which incorporates Ben Fry's "Table" class from his book "Visualizing Data". And there is one line in that "Table" class which refer to a "PrintWriter" class:
- // Write this table as a TSV file
- void write(PrintWriter writer) {
- for (int i = 0; i < rowCount; i++) {
- for (int j = 0; j < data[i].length; j++) {
- if (j != 0) {
- writer.print("\t");
- }
- if (data[i][j] != null) {
- writer.print(data[i][j]);
- }
- }
- writer.println();
- }
- writer.flush();
- }
Does anyone know what exactly is a "PrintWriter" class? is it part of the core library / its .jar files? and how can I incorporate it into Eclipse (like is there a .jar file that is supposed to be imported and added to build path - like core.jar ) .. and if so, what changes do I need to put in to my source code to use it? (like how to properly define / call it, etc)
Please help, and thanks in advance for taking timie to reply! :)
Cheers,
niM_xaM
1