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 is not a dupe. I would like to be able to do
Hope you guys don't mind me asking this question, but I find myself at
Hope this question wasn't asked before. Does anyone know the character limit for domain
Hope this question is not stupid since I am an amateur web designer. I
Hope this is possible- Have a table like so: Car_ID Brand Model Year ----------------------------------
hope this is my last question for today... O.o So im filling up a
Hope someone can help, I'm not a programmer, but have been interested in exploring
hope this is something simple and I am just missing it, but consider this
hope you can help me. I have html markup like this: <a href=error.htm class=button
Hope my question does not pose as too wide. So I try to frame

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.