Where does the code call any printer methods?this does not work properly only the file reader bit does, no printer options is ever displayed
Do you know how to call a method?
http://docs.oracle.com/javase/tutori...arguments.html
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Where does the code call any printer methods?this does not work properly only the file reader bit does, no printer options is ever displayed
Do you know how to call a method?
http://docs.oracle.com/javase/tutori...arguments.html
If you don't understand my answer, don't ignore it, ask a question.
Thanks this was the issue, i did update the original question as i am now getting errors, but it seems to have vanished
There is a variable with a null value when line 14 is executed.java.lang.NullPointerException
at java.text.AttributedString.<init>(AttributedString .java:127)
at PrintText.<init>(PrintText.java:14)
Look at line 14 and find the variable with the null value. Then backtrack in the code to see why that variable does not have a valid, non-null value.
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
If you don't understand my answer, don't ignore it, ask a question.
Thank you, the code at line 14 was in the wrong place, i have now put this into the print method, however i am now getting this error
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at java.text.AttributedString.<init>(AttributedString.java:127) at PrintText.print(PrintText.java:109) at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1973) at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1461) at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1277) at PrintText.printer(PrintText.java:98) at PrintText$1.run(PrintText.java:52) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:682) at java.awt.EventQueue$3.run(EventQueue.java:680) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:691) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
Now look at line 109 the same way you looked at line 14 in the previous error.Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.text.AttributedString.<init>(AttributedString .java:127)
at PrintText.print(PrintText.java:109)
If you don't understand my answer, don't ignore it, ask a question.