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

  • Home
  • SEARCH
  • 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 8365663
In Process

The Archive Base Latest Questions

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

Hello i am trying to Create the beginning of a full screen game and

  • 0

Hello i am trying to Create the beginning of a full screen game and i am having issues. I want a blue background with white text and the entire screen to be changed to 800*600. The problem is i get a screen with an 800*600 box in the middle(not visible but i can tell by mouse boundaries) and my background is black.


enter image description here


My Code:

import java.awt.*;

import javax.swing.JFrame;
/**
 * Write a description of class Full here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Full extends JFrame 
{

   public static void main(String[] args){
     DisplayMode dm = new DisplayMode(800,600,16, DisplayMode.REFRESH_RATE_UNKNOWN);  
     Full full = new Full();
     full.run(dm);

    }
   public void run(DisplayMode dm){
     setBackground(Color.BLUE);  
     setForeground(Color.WHITE);
     setFont(new Font("Arial", Font.PLAIN,24));

     Screen s = new Screen();
     try{
        s.setFullScreen(dm,this);
        try{
            Thread.sleep(15000);
        }catch(Exception ex){}
        }finally{
         s.restoreScreen();   
        }
    }
   public void paint(Graphics g){
       if(g instanceof Graphics2D){
           Graphics2D g2 = (Graphics2D) g;

g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        }
       g.drawString("This is gonna be awesome!!",200,200);
    }
}

public class Screen
{
  private GraphicsDevice vc;
  Window myWindow;
  public Screen(){
      GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
      vc = env.getDefaultScreenDevice();
    }
  public void setFullScreen(DisplayMode dm, JFrame myWindow){
      myWindow.setUndecorated(true);
      myWindow.setResizable(false);
      vc.setFullScreenWindow(myWindow);

      if(dm != null && vc.isDisplayChangeSupported()){
          try{
             vc.setDisplayMode(dm); 
            }catch(Exception ex){}
        }
    }
  public Window getFullScreenWindow(){
      return vc.getFullScreenWindow();
    }
  public void restoreScreen(){
      Window w = vc.getFullScreenWindow();
      if(w != null){
          w.dispose();
        }
      vc.setFullScreenWindow(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-06-09T12:42:41+00:00Added an answer on June 9, 2026 at 12:42 pm

    This is a short answer, because it seems that you are on the wrong trace 🙂

    Games should be using OpenGL or DirectX, so the graphical work is done by the GPU. I strongly recommend OpenGL, since it is compatible with every platform. The way you started, the game will run completely on the CPU, which is not good.

    Take a look at LWJGL (LightWeight Java Game Library). It is a cross-platform library that allows you to use OpenGL. It will require some Googling for tutorials, but it is really worth it. Your performance of the game will be a lot better, and your game will be made the way it has to be. Just to give you an idea, Minecraft is made with LWJGL.

    OpenGL allows you to make a quick start with your game development, using some simple methods, which is good first a first game experience. Later on, you will find out how to do things more efficient, but that would be too much information to start of with 😀
    Good luck!

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

Sidebar

Related Questions

Hello I'm trying to create text boxes dynamically using for loop and want to
What I try to do Hello Guys, I'm trying to create a Login-Screen which
Hello I am trying to create a brush but I am having problem with
Hello I am trying to create a custom expandable listview, but the documentation on
I'm trying to create an Hello World JSF application. I have a bean with
I'm trying to follow the instructions located at How-To Create a Hello World Snap-in
Hello, i'm trying to take detailed information from the database, i create a simple
Hello I am trying to create a stacked barplot using the following code: test
Hello I am trying to create a for loop that loops through the linked
Hello there i'm trying to create a form with Zend_Form that will enable my

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.