Results 1 to 2 of 2
  1. #1
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Question printAccoıunt Function

    I can't see what is wrong in this code... Can you help me, guys ?


    Java Code:
        private void printAccount() {
            PrinterJob pj = PrinterJob.getPrinterJob();
            pj.setJobName(" Print Component ");
    
            pj.setPrintable (new Printable() {    
            public int print(Graphics pg, PageFormat pf, int pageNum){
            if (pageNum > 0){
                return Printable.NO_SUCH_PAGE;
            }Graphics2D g2 = (Graphics2D) pg;
            g2.translate(pf.getImageableX(), pf.getImageableY());
            Account_name.paint(g2);                     // netbeans says "cannot  find symbol" right here. 
            return Printable.PAGE_EXISTS;
            }
        });
        if (pj.printDialog() == false)
        return;

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

    Default

    Chances are Account_name doesn't have a method paint that takes a Graphics2D argument.

    db

Similar Threads

  1. Calling function in Javascript- from other function
    By jdigger in forum New To Java
    Replies: 1
    Last Post: 02-27-2011, 10:00 PM
  2. Does this function cause lag?
    By Addez in forum New To Java
    Replies: 5
    Last Post: 12-06-2009, 11:53 AM
  3. Replies: 3
    Last Post: 12-04-2009, 04:08 PM
  4. Need help with get function
    By calicocal in forum New To Java
    Replies: 10
    Last Post: 11-09-2008, 08:59 PM
  5. Need a little help with a function!
    By Nuluvius in forum New To Java
    Replies: 3
    Last Post: 02-08-2008, 12:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •