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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:30:04+00:00 2026-06-04T19:30:04+00:00

I hope I’m not posting a duplicate question, but I wasn’t able to find

  • 0

I hope I’m not posting a duplicate question, but I wasn’t able to find a question like this so maybe I’m safe? Anyway…

For the applications that I’m making, I’m going to have two applications (two separate processes and windows) open at the same time. The computer on which these applications will be running on will have multiple monitors. I want the first application/ window to fullscreen and occupy one of my monitors (easy part), and the other one to be fullscreen on the second monitor. If possible, I would like for them to initialize this way.

At the moment, I am making my windows fullscreen by using this code:

this.setVisible(false);
this.setUndecorated(true);
this.setResizable(false);
myDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
myDevice.setFullScreenWindow(this);

The class that this is in is an extension of the JFrame class and myDevice is of the type “GraphicsDevice”. It’s certainly possible that there’s a better way to make my window fullscreen so that I can have two different applications fullscreen over two different monitors.

If I was unclear in any way, please say and I’ll try to edit in clarifications!

  • 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-04T19:30:06+00:00Added an answer on June 4, 2026 at 7:30 pm

    First, you need to position your frames on each screen devices.

    frame1.setLocation(pointOnFirstScreen);
    frame2.setLocation(pointOnSecondScreen);
    

    Then to maximize a frame, simply call this on your JFrame:

    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    

    Here is a working example illustrating that:

    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Frame;
    import java.awt.GraphicsDevice;
    import java.awt.GraphicsEnvironment;
    import java.awt.Point;
    
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.SwingUtilities;
    
    public class Test {
        protected void initUI() {
            Point p1 = null;
            Point p2 = null;
            for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) {
                if (p1 == null) {
                    p1 = gd.getDefaultConfiguration().getBounds().getLocation();
                } else if (p2 == null) {
                    p2 = gd.getDefaultConfiguration().getBounds().getLocation();
                }
            }
            if (p2 == null) {
                p2 = p1;
            }
            createFrameAtLocation(p1);
            createFrameAtLocation(p2);
        }
    
        private void createFrameAtLocation(Point p) {
            final JFrame frame = new JFrame();
            frame.setTitle("Test frame on two screens");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel panel = new JPanel(new BorderLayout());
            final JTextArea textareaA = new JTextArea(24, 80);
            textareaA.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
            panel.add(textareaA, BorderLayout.CENTER);
            frame.setLocation(p);
            frame.add(panel);
            frame.pack();
            frame.setExtendedState(Frame.MAXIMIZED_BOTH);
            frame.setVisible(true);
        }
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
    
                @Override
                public void run() {
                    new Test().initUI();
                }
            });
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope this question is not stupid since I am an amateur web designer. I
Hope this is not a stupid question. For Regression testing, I wrote a small
Hope this question wasn't asked before. Does anyone know the character limit for domain
Hope this is not too broad but after a lot of googling I am
hope all is swell! I was hoping I had cracked this problem but it
Hope someone could help me with this: I would like to have a column
Hope this isnt a repost, at least I didnt find any results that I
Hope it's not against rules to post more than 1 question per page. I
Hope this question hasn't been asked before. I've got the following working <!-- 640x920
Hope it is possible: I have a delegate like this: delegate bool X(); I

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.