• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error in Printable  RSS feed

 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, nice to be here. I'm new to java. I am having error at the print() method, that is, **public int print(Graphics g, PageFormat pf, int pageIndex)throws PrinterException** MY ERROR MESSAGE IS: Missing Return Statement Add @Override Annotation. Please what next? Thanks.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please show us your Printable class?
 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, so grateful for your quick response. I have actually found where the error was. Now there are no errors shown. However, when i click the button on my GUI where the print codes are written, it does not show any response at all. What could be the cause? I actually refer to the print code sent in by Arockiaraj Swaminatha on May, 2001 @22:23:00. Perhaps, the code is not what i should use to print. I need print codes that will enable user to print text on the jTextFields after the user has searched from the database and displayed them on the GUI. My application is working except the print part. Thank you.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please TellTheDetails? I can't tell what the cause is because I have no idea what your code looks like. Please post an SSCCE (<= link) that shows the problem.
Also, you refer to a specific post. Can you give a link to the thread the post is in?
 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your concern. The code below is the one i have been making reference to:





Please, if this codes would not work for me, kindly send me a print code that will allow user print data after a successful search from database and displaying same on the jTextFields on the GUI. Thank you for the anticipated assistance.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Don wrote:
Please, if this codes would not work for me, kindly send me a print code that will allow user print data after a successful search from database and displaying same on the jTextFields on the GUI. Thank you for the anticipated assistance.

First, I added code tags to your post, to preserver the formatting and generally make it easier to read. Please do the same in any future posts by clicking the 'code' button, then pasting your code between the tags - between the ']' and '['.

Second, nobody here should "send (you) a print code that will allow user print data". We don't write your code for you. We will do everything we can to HELP you, but nobody here will do it FOR you.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote: . . . I added code tags to your post, to preserver the formatting and generally make it easier to read. . . .
Unfortunately it accentuated the poor indentation and excess whitespace and long lines, which made it harder to read. I have sorted out a few of those problems, particularly multiple spaces at the end of the line.
 
Joe Don
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although you did work on the codes, it neither worked nor showed any error mesages. Still confused up till now. Any other suggested help? Please, assist.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Don wrote:Although you did work on the codes, it neither worked


Of course not. As already stated, folks here won't do your work for you. Nobody changed your code, only formatted it to be more readable.

nor showed any error mesages.


So it compiles and runs, and just doesn't do what you want?

Any other suggested help? Please, assist.


TellTheDetails(⇐click). It's still not clear what problem you're having, or where it's occurring.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!