Skip to content

Commit 3a7f080

Browse files
committed
fix screen information shown in customer tool
fixes #30 (cherry picked from commit db2f65e)
1 parent 57ce6e4 commit 3a7f080

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Customer/src/main/java/de/openindex/support/customer/CustomerFrame.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
import java.awt.Dimension;
2424
import java.awt.FlowLayout;
2525
import java.awt.Font;
26+
import java.awt.GraphicsConfiguration;
2627
import java.awt.GraphicsDevice;
2728
import java.awt.GraphicsEnvironment;
29+
import java.awt.Rectangle;
2830
import java.awt.event.WindowAdapter;
2931
import java.awt.event.WindowEvent;
3032
import javax.swing.BorderFactory;
@@ -153,8 +155,12 @@ public void changedUpdate(DocumentEvent e) {
153155
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
154156
final JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
155157
final GraphicsDevice screen = (GraphicsDevice) value;
158+
final GraphicsConfiguration cfg = screen.getDefaultConfiguration();
159+
final Rectangle bounds = cfg.getBounds();
156160

157-
label.setText(screen.getIDstring() + " (" + screen.getDisplayMode().toString() + ")");
161+
label.setText(screen.getIDstring() + " ("
162+
+ bounds.width + "x" + bounds.height + "@" + cfg.getColorModel().getPixelSize() + "bpp; "
163+
+ "x=" + bounds.x + "; y=" + bounds.y + ")");
158164
return label;
159165
}
160166
});

0 commit comments

Comments
 (0)