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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:38:05+00:00 2026-06-05T10:38:05+00:00

I get an error with setDisplayMode It says that The method Display.setDisplayMode(new DisplayMode[], String[])

  • 0

I get an error with

setDisplayMode

It says that “The method Display.setDisplayMode(new DisplayMode[], String[]) in the type Display is not applicable for the arguments (Display Mode)” and it suggests to “Rename in file”.

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Display;


public class GameLoop 
{
    //Main
        public static void main(String[] argv)
        {
            GameLoop.start();
        }

        //Metodo che gestisce il loop
        public static void start() 
        {
            //Inizializzazione OpenGL
            GL11.glMatrixMode(GL11.GL_PROJECTION);
            GL11.glLoadIdentity();
            GL11.glOrtho(0, 800, 600, 0, 1, -1);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);

            try 
            {
                Display.setDisplayMode(new DisplayMode(800, 600));
                Display.create();
            } catch (LWJGLException e) 
            {
                e.printStackTrace();
                System.exit(0);
            }

            while(!Display.isCloseRequested())
            {
                Entità.pulisci();
                Entità.colora();
                Entità.disegna();
                Display.update();
            }
        }

}




import org.lwjgl.opengl.GL11;

public class Entità 
{
    //Disegna un poligono
        public static void disegna()
        {
            GL11.glBegin(GL11.GL_QUADS);
            GL11.glVertex2f(100,100);
            GL11.glVertex2f(200,100);
            GL11.glVertex2f(200,200);
            GL11.glVertex2f(100,200);
            GL11.glEnd();
        }

        //Pulisce il buffer
        public static void pulisci()
        {
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); 
        }

        //Setta il colore al poligono
        public static void colora()
        {
            GL11.glColor3f(0.5f,0.5f,1.0f);
        }

}
  • 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-05T10:38:07+00:00Added an answer on June 5, 2026 at 10:38 am

    The problem is in the line:

    import org.lwjgl.util.Display;
    

    You import the wrong Display class. Instead use:

    import org.lwjgl.opengl.Display;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have enum list and method and i get error: not all code paths
Why do I get Error The type 'string' must be a non-nullable value type
when is do this i get error: incompatible type for argument 1 of ‘display’
I get error: Format exception was unhandled, Input string was not in a correct
Why I get error with this query on my live server but not on
i get error of this type: in function ... multiple definition of ... ...
Possible Duplicate: Why do I get error: … must be a reference type in
I get error TypeError: 'int' object is not subscriptable what should I do to
I get error C2027: use of undefined type 'Bridge' and error C2227: left of
I get this error while using cookie_jar method: Can't call method cookie_jar on an

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.