Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8365235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:36:42+00:00 2026-06-09T12:36:42+00:00

So I know I suck at programming, but if anyone could give me some

  • 0

So I know I suck at programming, but if anyone could give me some code help I would appreciate it, I don’t know why I am getting this error

cannot find symbol

  g.drawImage(movPic2, 35, 515, 200, 200,this);                 ^
  symbol:   variable movPic2
  location: class MovieDis

if any1 could give me a code snippet example i have trouble understanding in just words.
tired of this program and just wanting to get done with it.

import java.awt.*;
import javax.swing.*;
import javax.swing.JComponent.*;

public class Movie extends JApplet {

    private String movName1;
    private String director1;
    private int yearMade1;
    private Image movPic1;
    private String movName2;
    private String director2;
    private int yearMade2;
    private Image movPic2;
    private String movName3;
    private String director3;
    private int yearMade3;
    private Image movPic3;
    private String movName4;
    private String director4;
    private int yearMade4;
    private Image movPic4;

    public void init() {
        MovieDis goo = new MovieDis(movPic1, movPic2, movPic3, movPic4);
        goo.setBounds(0, 0, 750, 500);
        add(goo);
    }
}

class MovieDis extends JComponent {

    private String movName1;
    private String director1;
    private int yearMade1;
    private Image movPic1;
    private String movName2;
    private String director2;
    private int yearMade2;
    private Image movPic2;
    private String movName3;
    private String director3;
    private int yearMade3;
    private Image movPic3;
    private String movName4;
    private String director4;
    private int yearMade4;
    private Image movPic4;

    public MovieDis(Image movPic1, Image movPic2, Image movPic3, Image movPic4) {
        setBackground(Color.black);
        movPic1 = Toolkit.getDefaultToolkit().createImage("Shaw.jpg");
        movPic2 = Toolkit.getDefaultToolkit().createImage("dances.jpg");
        movPic3 = Toolkit.getDefaultToolkit().getImage("Inception.jpg");
        movPic4 = Toolkit.getDefaultToolkit().getImage("Cuckoo.jpg");
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.black);
        g.fillRect(0, 0, 750, 500);
        g.drawImage(movPic1, 35, 35, 200, 200, this);
        g.drawImage(movPic2, 35, 515, 200, 200, this);
        g.drawImage(movPic3, 265, 35, 200, 200, this);
        g.drawImage(movPic4, 35, 515, 200, 200, this);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:36:43+00:00Added an answer on June 9, 2026 at 12:36 pm

    the variable movPic1 (and 2-4) are not stored anywhere inside your MovieDis class. That’s why the paintComponent() method is complaining. You need to add those to MovieDis and then assign them in your class constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know maybe this is a stupid question, But i suck at sql But
Know this might be rather basic, but I been trying to figure out how
I know that this sort of question has been asked here before, but still
i know this is a stupid question but i d'ont know how to do
I made a mistake uninstalling Aptana PHP as I didn't know PDT would suck
I've spent a lot of time reading c tutorials and getting this code to
I know you can not set a key value dynamically, but what about the
I know that Phonegap has an event for back button, but it's only available
Anyone know how I can make a login button in Ruby on Rails for
I'm really sorry. This must seem like an incredibly stupid question, but unless I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.