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 7569807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:15:32+00:00 2026-05-30T15:15:32+00:00

Eclipse says I can’t make a static reference to the non-static field Art.instance. Why

  • 0

Eclipse says I can’t make a static reference to the non-static field Art.instance. Why does it think I’m calling Art.instance from a static context?

TDRenderer itself gets called like so:

renderer = new TDRenderer();

TDRenderer.java:

package towerDefense;

import java.awt.Graphics;
import java.awt.Image;

public class TDRenderer {

    public Art art;

    public TDRenderer()
    {
        art = Art.instance;
    }

    public void render(Graphics g)
    {
        for(int i = 0; i < 32; i++)
        {
            for(int j = 0; j < 24; j++)
            {
                Image itd = (Image)(art.sprites[art.level1.tiles[i][j].type]);
                g.drawImage(itd, itd.getWidth(null), itd.getHeight(null), null);
            }
        }
    }
}
  • 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-05-30T15:15:33+00:00Added an answer on May 30, 2026 at 3:15 pm

    It’s not that you’re in a static context; it’s that instance is not a static field of Art, but referencing it as Art.instance means you’re trying to use it as if it were static.

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

Sidebar

Related Questions

I think the question says it all. I'm new to Eclipse plugin development, so
Possible Duplicate: what can I do to make display the bin folder on eclipse?
In Eclipse, if you run a program under Debug you can make changes to
Currently, I have a machine on which I am working in Eclipse, it says
Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not
While either IntelliJ or Eclipse are running, I can see how much heap they
I'm stepping through code using Eclipse PDT. When I mouseover an array it says
I've created a project in eclipse and added maven dependencies. In Eclipse, it says
As the heading says. I would like to know how can i do this
http://code.google.com/p/apps-for-android/ I have eclipse setup with Subversive plugin, I can download the codes down

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.