Skip to content

Commit

Permalink
fix screen information shown in customer tool
Browse files Browse the repository at this point in the history
fixes #30

(cherry picked from commit db2f65e)
  • Loading branch information
pinhead84 committed Mar 22, 2019
1 parent 57ce6e4 commit 3a7f080
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -23,8 +23,10 @@
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
Expand Down Expand Up @@ -153,8 +155,12 @@ public void changedUpdate(DocumentEvent e) {
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
final JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
final GraphicsDevice screen = (GraphicsDevice) value;
final GraphicsConfiguration cfg = screen.getDefaultConfiguration();
final Rectangle bounds = cfg.getBounds();

label.setText(screen.getIDstring() + " (" + screen.getDisplayMode().toString() + ")");
label.setText(screen.getIDstring() + " ("
+ bounds.width + "x" + bounds.height + "@" + cfg.getColorModel().getPixelSize() + "bpp; "
+ "x=" + bounds.x + "; y=" + bounds.y + ")");
return label;
}
});
Expand Down

0 comments on commit 3a7f080

Please sign in to comment.