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.

Results 1 to 7 of 7

Thread: How to print image on applet

  1. #1
    Member
    Join Date
    Oct 2012
    Posts
    133
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default How to print image on applet

    import java.awt.*;
    import javax.swing.*;
    hi i just started with java 2 days ago. and i cant seem to print image on applet.
    there are no errors so i am guess problem is in imageIcon path?
    public class IMAGE extends JApplet
    {
    ImageIcon yanks;

    public void init()
    {
    yanks = new ImageIcon("C:\\Users\\dva\\Pictures\\JAVAIMAGES\\c h1.png");
    }

    public void paint(Graphics g)
    {
    yanks.paintIcon(this, g, 100, 100);

    }
    }


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: How to print image on applet??????????????????????????????????????????? this is n

    Not sure if I should reply as I don't know if you've read my reply in your previous question.

  3. #3
    Member
    Join Date
    Oct 2012
    Posts
    133
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: How to print image on applet??????????????????????????????????????????? this is n

    i did read ur post and i know what is wrong but i dont know how to fix it.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,308
    Thanks
    181
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: How to print image on applet

    Posting a thread title with 30+ questions marks is bound to annoy more than one person. For everyone's benefit I have removed them from your title, and I would recommend refraining from doing so again, and as curmudgeon alluded to acknowledge the advice you receive, and if you are still confused ask a specific question in response.

    In reply to your question, here are two tutorials I recommend reading to learn how to accomplish what you want:
    How to Use Labels (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    Trail: 2D Graphics (The Java™ Tutorials)

  5. #5
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: How to print image on applet??????????????????????????????????????????? this is n

    Quote Originally Posted by hwoarang69 View Post
    i did read ur post and i know what is wrong but i dont know how to fix it.
    Then kindly reply to my post in your other thread with your specific questions. If you ignore it, we won't know if you'll ignore posts in your other questions as well, and this may demotivate folks from replying to you.

  6. #6
    Member
    Join Date
    Oct 2012
    Posts
    133
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: How to print image on applet

    chill out!!!!!!

    today is my first day on a coding form website. i trying to figure it out as i go on.

    and about the code problem, i just found out what i was doing wrong but thanks any way.

  7. #7
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 139 Times in 134 Posts

    Default Re: How to print image on applet

    I'm calm, but I just wanted to point out that in general you'll want to reply to replies in previous threads before asking new questions. We're all volunteers and we like to see acknowledgement that our suggestions have been read. That's really not asking too much of you , is it?

Similar Threads

  1. error in print image onto applet
    By hwoarang69 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 20th, 2012, 08:17 PM
  2. Applet Image Reading
    By 77times in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 29th, 2012, 11:25 PM
  3. xfa.host.print: print a page + some page range.
    By gammaman in forum Totally Off Topic
    Replies: 2
    Last Post: May 10th, 2012, 08:07 AM
  4. Applet array paint/print question
    By allhuber in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 30th, 2012, 07:42 AM
  5. Need help on print , scrollbar for my applet
    By Anandprasad in forum Member Introductions
    Replies: 2
    Last Post: May 12th, 2011, 09:00 AM