• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Displaying a Java Swing application to an HDMI monitor/TV?

 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been Googling for a while and can't seem to find any relevant information on this.
I have a PC with a single video card, displaying to an LCD monitor.

I would like to add a second video card which supports HDMI, and have that display on my HDMI television.

I would then like to create a Java Swing application which will use that video card (and display on the TV).

Can anyone please provide me some idea of where to start?

From within the Swing application, can I tell it which video card to use? Is this something I need to set in the VM arguments somehow?

The Java application is going to be a service that will be run (eventually) on a headless PC, so I don't want to have to interact with it manually to get it to display on the "tv" monitor.

Thanks for any pointers,
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I run my machine with multiple monitors, I use the machine's display settings to decide which application should be displayed where. I do not think there is anything in Swing which will let you take this decision.
 
Sheriff
Posts: 22809
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually there is: GraphicsEnvironment, GraphicsDevice and GraphicsConfiguration. You start using them from left to right: get a GraphicsEnvironment instance, use that to get GraphicsDevice instances (the "screens"), and use those to get their GraphicsConfiguration instances.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Boy! This is awesome. Learnt something new today.
Thanks Rob.
 
Rob Spoor
Sheriff
Posts: 22809
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the help. So if I want a Java Swing application to display on an HDTV which supports 1080p, what resolution do I need to use?
Is there a specific resolution that will enable my application to make the best use of the 1080p TV monitor?

Is this something that is configured in the Video card driver (I don't have such a card yet, so I can't easily check).

Thanks,
 
Rob Spoor
Sheriff
Posts: 22809
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1080p is 1920×1080. Which coincides with the resolution I can use if I connect my TV to my PC.
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic