Results 1 to 3 of 3
  1. #1
    tedley24 is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default GraphicsConfiguration reversing monitor order in GraphicsDevice[]

    Hi all,

    I have a rather perplexing problem, for me anyway. I am modifying very large swing application to facilitate a dual monitor configuration (using JSE 1.6.20). The issue is that the application does not always properly identify the primary and secondary monitors correctly.

    GraphicsConfiguration.getScreenDevices() sometimes returns the the monitors in the proper order and sometimes does not. It varies by the computer on which it's being tested. I have noticed that if I create a JFrame without a GraphicsConfiguration, it will always present on the correct screen (monitor 1 of 2). My work around has been to snatch the value of GraphicsDevice.getIDstring() from the properly-displayed JFrame and sort GraphicsDevice[] by that value placing the entry with that value as the first element in that array. It works like a charm but I shouldn't have to do that.

    IT has checked all the drivers on the computers we have tested on and they are exactly the same versions. I have also made sure the monitor setup is correct. Anyone have any ideas? Is this a known bug or am I missing something?

    Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default

    1. GraphicsConfiguration does not have a method getScreenDevices()

    2. The contract of GraphicsEnvironmemt.getScreenDevices() makes no promises as to the order in which the array will be populated. So no, it's not a bug, known or otherwise, that the order isn't consistent.

    3. GraphicsEnvironment also has a method getDefaultScreenDevice() which is probably what you are looking for.

    db

  3. #3
    tedley24 is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default getDefaultScreenDevice()

    I wondered about the order not being guaranteed but didn't see anything in the documentation about it one way or the other.

    The getDefaultScreenDevice() method works perfectly for what I need to do.

    Thanks!

Similar Threads

  1. reversing digits
    By gandalf5166 in forum New To Java
    Replies: 3
    Last Post: 03-06-2010, 04:34 PM
  2. Replies: 2
    Last Post: 10-08-2009, 11:48 AM
  3. Reversing the String
    By Inaam in forum New To Java
    Replies: 1
    Last Post: 03-30-2009, 08:35 PM
  4. Reversing
    By whosadork in forum New To Java
    Replies: 14
    Last Post: 11-06-2008, 04:29 AM
  5. Reversing String
    By mew in forum New To Java
    Replies: 4
    Last Post: 12-02-2007, 09:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •