Reputation: 46
I have a list that needs to get all the video displays and add them all, however I need to add them as a label and get the name of it, but I do not see any String in GraphicsDevice that would return the name.
GraphicsDevice[] list = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
if (list != null) {
if (list.length >= 1) {
for (GraphicsDevice device : list) {
observableList.add(new Label(DEVICE NAME HERE));
}
}
}
Thank you
Upvotes: 0
Views: 252
Reputation: 48572
The GraphicsDevice.getIDstring() method provides such a String. Usage:
observableList.add(new Label(device.getIDstring()));
Upvotes: 1