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: Thank you Java programmers and for my codes too...program I have

  1. #1
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    117
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Thank you Java programmers and for my codes too...program I have

    I have a problem I want you to help me with. Easy. But I cannot do it. Because of limited use of the computers for now. But easy.

    https://www.sportshawaii.com/sh/viewtopic.php?t=52457

    This website is the site. I want you to trash the living daylights out of the website. The guy's name is Bernard Carvalho. Kaua'i County Councilmen. Ross Kagawa also Kaua'i County Councilmen.

    The codes I have is from a project called JFrame.

    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import java.imageio.imageio;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
     
    public class RunGIF   {
     
         public static void main(String[] args)  throws IOException   {
          //create JFrame
          JFrame frame = new JFrame();
          //create JLabel
          JLabel label = new JLabel();
          //Read Gif file
          BufferedImage image = ImageIO.read(new File("placesomepic.jpg here"));
          //set the GIF as the Icon of the JLabel
          Label.setIcon(new ImageIcon(Image));
          //add the JLabel to the JFrame
          frame.add(label);
          //set the size of the frame
          frame.setSize(image.getWidth(), image.getHeight());
          //make the JFrame visible
          frame.setVisible(true)
          }
     
     
        }  //end program

    Here's what I hope you fellow programmers can do for me using netBeans. I want you to trash the living day lights out of this forum. That's the URL address and name of the file. If u have, put a file of Bernard Carvalho at a Kaua'i War Memorial convention hall picture with his name on the picture. Go on text to photo online to do this. This is free to do. That's my project to you.

    I cannot do this, because i don't want to get banned from this forum. Some network administrator where I live loves their dicks.

    Thanks forums goers..

    Helium c2

  2. The Following User Says Thank You to Helium c2 For This Useful Post:

    JessicaAaron (April 30th, 2024)

  3. #2
    Junior Member
    Join Date
    Jul 2023
    Location
    Castleton, Vermont
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Thank you Java programmers and for my codes too...program I have

    This is a very heavy issue. It needs time behind it.

  4. #3
    Member
    Join Date
    Jan 2024
    Posts
    75
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Thank you Java programmers and for my codes too...program I have

    It looks like you're trying to display an image using Java Swing and you're encountering some issues. To assist you, I've outlined the steps you can take to fix the problem:

    1. Import Correct Packages: Ensure you import the correct packages for ImageIO and BufferedImage. It seems like there's a typo in `java.imageio.imageio;`, it should be `javax.imageio.ImageIO;`.

    2. Correct Variable Naming: There's a mismatch in variable names. You're creating an object `label`, but then you're trying to set the icon for `Label`. Ensure consistency in variable naming.

    3. Correct File Path: Replace `"placesomepic.jpg here"` with the correct file path of your image. Make sure the image file is in the correct location relative to your Java file.

    4. Fix Typo: You're trying to set the ImageIcon using `Label.setIcon(new ImageIcon(Image));`. It should be `label.setIcon(new ImageIcon(image));`.

    5. Fix Syntax Errors: There are missing semicolons at the end of some lines: `frame.setVisible(true);` and `frame.setSize(image.getWidth(), image.getHeight());`.

    Here's the corrected version of your code:

    ```java
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;

    public class RunGIF {

    public static void main(String[] args) throws IOException {
    // create JFrame
    JFrame frame = new JFrame();
    // create JLabel
    JLabel label = new JLabel();
    // Read image file
    BufferedImage image = ImageIO.read(new File("path/to/your/image.jpg"));
    // set the image as the Icon of the JLabel
    label.setIcon(new ImageIcon(image));
    // add the JLabel to the JFrame
    frame.add(label);
    // set the size of the frame
    frame.setSize(image.getWidth(), image.getHeight());
    // make the JFrame visible
    frame.setVisible(true);
    }
    }
    ```

    Replace `"path/to/your/image.jpg"` with the actual path to your image file. After making these changes, your program should display the image correctly. If you still encounter difficulties or need further help with Java assignment, feel free to seek additional help from various online resources, assignment help sites like ProgrammingHomeworkHelp.com or communities where experienced programmers are willing to offer guidance and support.

Similar Threads

  1. java program codes for fast food ordering system
    By lubxter in forum Object Oriented Programming
    Replies: 2
    Last Post: October 7th, 2013, 10:36 PM
  2. java program codes for fast food ordering system
    By harleypogi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 1st, 2013, 04:42 AM
  3. java program codes for fast food ordering system
    By jeasay in forum Java Theory & Questions
    Replies: 1
    Last Post: July 20th, 2013, 11:52 PM
  4. Replies: 0
    Last Post: May 23rd, 2013, 04:35 PM
  5. Hi java programmers!
    By wennam in forum Member Introductions
    Replies: 1
    Last Post: January 27th, 2011, 07:12 AM

Tags for this Thread