Thread: Dual display

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0

    Dual display


    good day sir I have a project with dual display
    it is possible to modify the display of two monitor but not same output in one source.
    what can i add in my code.

    here is my code that display only one source but same output


    [CODE = java]
    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 p1) {
    final JFrame frame = new JFrame();
    frame.setTitle("Test frame on one 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(p1);
    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();
    }
    });
    }

    }

    [/CODE]
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0
    hello theres anyone who can help me with my problem ..

IMN logo majestic logo threadwatch logo seochat tools logo