aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Displaying a Java Swing application to an HDMI monitor/TV? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Displaying a Java Swing application to an HDMI monitor/TV?" Watch "Displaying a Java Swing application to an HDMI monitor/TV?" New topic
Author

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

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Boy! This is awesome. Learnt something new today.
Thanks Rob.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

You're welcome.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
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

Joined: Oct 27, 2005
Posts: 19722
    
  20

1080p is 1920×1080. Which coincides with the resolution I can use if I connect my TV to my PC.
 
wood burning stoves
 
subject: Displaying a Java Swing application to an HDMI monitor/TV?