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 3 of 3

Thread: Willing to give 1,000 doll hairs if you can help me with this.

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Willing to give 1,000 doll hairs if you can help me with this.

    I need your help!
    I am switching to netbeans and have been having some major problems.
    After about 6 hours I finally figured out how to get the image to show in netbeans.
    Is there a way to write the code where it will work in JGrasp and netbeans?

    The working code for netbeans is


    menuPic = new javax.swing.JButton();
        menuPic.setIcon(new javax.swing.ImageIcon(getClass().getResource("image/w2.png")));

    and the working code for JGrasp is



    menuPic = new JButton();
        ImageIcon bottompic = new ImageIcon("image/w2.png");
        JButton menuPic = new JButton(bottompic);


    I hate JGrasp but thats what my teacher uses to grade, so I want to be able to write it in netbeans and copy and paste the code to JGrasp and it be able to work.
    Any help would be greatly appreciated!!


  2. #2
    Member
    Join Date
    Jul 2012
    Posts
    83
    My Mood
    Cynical
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: Willing to give 1,000 doll hairs if you can help me with this.

    Cross-posted and answered on stackoverflow: how-to-show-image-in-joptionpane-in-netbeans

  3. The Following User Says Thank You to Fubarable For This Useful Post:

    copeg (July 1st, 2012)

  4. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Willing to give 1,000 doll hairs if you can help me with this.

    Also posted here OMG please help! | DaniWeb
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Give Me Some Project Ideas!
    By Emperor_Xyn in forum Java Theory & Questions
    Replies: 16
    Last Post: January 18th, 2012, 03:06 AM
  2. Replies: 4
    Last Post: February 23rd, 2011, 09:20 AM
  3. Trying to Give Coins For Change
    By bengregg in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 27th, 2011, 04:21 PM
  4. Sting format give more truble
    By ahmethbaai in forum Java Theory & Questions
    Replies: 1
    Last Post: December 17th, 2009, 01:19 PM
  5. New give thanks feature
    By JavaPF in forum The Cafe
    Replies: 0
    Last Post: April 11th, 2009, 11:14 AM