Lucas Breeden
Lucas Breeden

Reputation: 46

How can I get the name of a GraphicsDevice

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

Answers (1)

The GraphicsDevice.getIDstring() method provides such a String. Usage:

observableList.add(new Label(device.getIDstring()));

Upvotes: 1

Related Questions