Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • 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,
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Boy! This is awesome. Learnt something new today.
Thanks Rob.
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • 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
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic