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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:31:24+00:00 2026-06-08T10:31:24+00:00

When I get to the section the following is equivalent, I am trying to

  • 0

When I get to the section “the following is equivalent”, I am trying to show how one would execute the vc.setFullScreenWindow(window) all in one command but I am confusing myself because I am pretty new to this.

That is my main question, but if anyone can just explain anything worth noting about the GraphicsEnvironment or the JFrame while they are at it, I’d be much obliged.

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

// Screens2 can use all methods that JFrame has
public class Screens2 extends JFrame{


// Video Card used for Utilizing the graphics on the computer SCREEN
private GraphicsDevice vc;

// The Constructor merely sets the default Screen graphics up
public Screens2(){

    // The OS specific Graphics Envirionment
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();


    // Graphics Device vc = The Default();
    vc = env.getDefaultScreenDevice();

}

// he DisplayMode class encapsulates the bit depth, 
// height, width, and refresh rate of a GraphicsDevice. 
// this method also takes in a JFrame to Display the DisplayMode
public void setFullScree(DisplayMode dm, JFrame window){

    // Nothing fancy
    window.setUndecorated(true);
    window.setResizable(false);

    // The following is equivalent =======================================================
    private GraphicsDevice.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(window);
    vc.setFullScreenWindow(window);

}
}
  • 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-08T10:31:26+00:00Added an answer on June 8, 2026 at 10:31 am

    This line you mentioned is messed up a little:

    private GraphicsDevice.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(window);
    

    The compiler assumes you want to create a private member variable inside a method. See Declaring Member Variables. Also the starting GraphicsDevice is not needed.

    Replace it with the following:

    GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(window);
    

    Check out Lesson: Full-Screen Exclusive Mode API for more details about full screen exclusive mode.

    Consider the following example that demonstrates a frame in full screen mode:

    import java.awt.BorderLayout;
    import java.awt.GraphicsEnvironment;
    import java.awt.event.ActionEvent;
    
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    
    public class FullScreenDemo {
    
        private static void createAndShowGUI() {
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            frame.setLayout(new BorderLayout());
            frame.add(new JLabel("Hit Escape to exit full screen", JLabel.CENTER), BorderLayout.CENTER);
    
            frame.setSize(300, 300);
    
            KeyStroke escapeKeyStroke = KeyStroke.getKeyStroke("ESCAPE");
            Action escapeAction = new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(null);       
                }
            };
    
            frame.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escapeKeyStroke, "ESCAPE");
            frame.getRootPane().getActionMap().put("ESCAPE", escapeAction);     
    
            GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
        }
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In console application I'm trying to get section key value pair but I couldn't.
I have been trying to get this one section of my UI to immediatly
I'm trying to get the following query to function but I'm having difficulties with
I have tried following method to get subject section abstractPolicy.getTarget().getSubjectsSection() but from that it
In the get section of the inherited property, you could throw a NotImplementedException. But
I've been trying to get the camera section on my app working for about
I am trying to get a loop for following... {$product.min_val} //2 {$product.max_val} //8 and
I am currently following Michael Hartl's tutorial on RoR and am trying to get
I have the following class: public class MySeat { public string Section { get;
I am trying to get a parallel effect in C++ program using the following

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.