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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:12:06+00:00 2026-06-14T10:12:06+00:00

I have to run an application in dual screen mode. How can I run

  • 0

I have to run an application in dual screen mode. How can I run the application on both screen as independent window but sharing the same application model?

  • 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-14T10:12:07+00:00Added an answer on June 14, 2026 at 10:12 am

    If i am not wrong,this eg may help you.
    1st position your frames on each screen devices.

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

    to maximize:

    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    

    working example:

    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 GuiApp1 {
    protected void twoscreen() {
        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() {
    
    
            public void run() {
                new GuiApp1().twoscreen();
            }
        });
     }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run my program step by step, but still, I can't find where
By default configuration in a new workspace I have Run as Web Application in
I have to run some other application from my program and hide it's form.
I have run into a problem... I'm trying to use QTKit in an application
I suddenly have Run and Search in the menubar of my RCP application. Is
I am developing an xbap application and have run into a problem with users
I'm working on an EntityFramework application and I have run across a problem when
I have used the andengine.jar file in our application. I have run the physicsexample.
I run an application as a service on a server and then I have
I have a user of my application that sometimes when they run the application

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.