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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:17:32+00:00 2026-06-04T14:17:32+00:00

I have a fullscreen JFrame that I developed on my MacBook, and it worked

  • 0

I have a fullscreen JFrame that I developed on my MacBook, and it worked great. The background was able to change colors and stuff. Now I moved it over to my Windows box and the background is white, and it doesn’t seem to want to change when I tell it to. Why could that be?

This is the code for setting up my windows (in a nutshell):

JFrame frame;
DisplayMode dm;
frame = new JFrame();
frame.setBackground(new Color(0.3F, 0.3F, 0.3F));
dm = new DisplayMode(Main.width, Main.height, 32, DisplayMode.REFRESH_RATE_UNKNOWN);
screen = new ScreenManager();
screen.setFullScreen(dm, frame);

This is the code for setting JFrames fullscreen.

import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Window;

import javax.swing.JFrame;

public class ScreenManager
{
    public static GraphicsDevice vc;

    public ScreenManager()
    {
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        vc = env.getDefaultScreenDevice();
    }

    public void setFullScreen(DisplayMode dm, JFrame window)
    {
        window.setUndecorated(true);
        window.setResizable(false);
        vc.setFullScreenWindow(window);
        if (dm != null && vc.isDisplayChangeSupported())
        {
            try
            {
                vc.setDisplayMode(dm);
            }
            catch (IllegalArgumentException e)
            {
                //No need to do anything.
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
    }
}
  • 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-04T14:17:33+00:00Added an answer on June 4, 2026 at 2:17 pm

    The only thing I could think of is the JFrame is being set to a color–this won’t do anything.

    Try this

    JFrame frame = new JFrame();
    frame.getContentPane().setBackground(new Color(0.3F, 0.3F, 0.3F));
    

    You’d be setting the color of the pane itself instead of just the Frame.

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

Sidebar

Related Questions

We have an online movie that displays full-screen. Instead of the now-standard flash-based fullscreen,
I have a WPF application that is a fullscreen kiosk app. It's actually a
I have an Xulrunner app that loads fullscreen without any controls and loads a
I have a MPMoviePlayerController object that plays a video fullscreen in either portrait or
I have a game app that has the ability to go fullscreen and back
I have an application that runs in fullscreen mode and has been working fine.
I have a fullscreen c# application and I want that the cursor won't be
I have a WPF window that goes fullscreen, and I have made every attempt
I have been trying to make my Mac application enter fullscreen now for a
I have a fullscreen drawing app that disables the title and status bars using

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.