(Frame frame)
| 46 | |
| 47 | |
| 48 | public About(Frame frame) { |
| 49 | super(frame); |
| 50 | |
| 51 | icon = Toolkit.getLibIconX("about"); |
| 52 | width = icon.getIconWidth(); |
| 53 | height = icon.getIconHeight(); |
| 54 | |
| 55 | /* |
| 56 | if (Toolkit.highResDisplay()) { |
| 57 | image = Toolkit.getLibImage("about-2x.jpg"); //$NON-NLS-1$ |
| 58 | width = image.getWidth(null) / 2; |
| 59 | height = image.getHeight(null) / 2; |
| 60 | } else { |
| 61 | image = Toolkit.getLibImage("about.jpg"); //$NON-NLS-1$ |
| 62 | width = image.getWidth(null); |
| 63 | height = image.getHeight(null); |
| 64 | } |
| 65 | */ |
| 66 | |
| 67 | addMouseListener(new MouseAdapter() { |
| 68 | public void mousePressed(MouseEvent e) { |
| 69 | dispose(); |
| 70 | } |
| 71 | }); |
| 72 | |
| 73 | addKeyListener(new KeyAdapter() { |
| 74 | public void keyTyped(KeyEvent e) { |
| 75 | System.out.println(e); |
| 76 | if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { |
| 77 | dispose(); |
| 78 | } |
| 79 | } |
| 80 | }); |
| 81 | |
| 82 | // Dimension screen = Toolkit.getScreenSize(); |
| 83 | // setBounds((screen.width-width)/2, (screen.height-height)/2, width, height); |
| 84 | setSize(width, height); |
| 85 | // setLocationRelativeTo(null); |
| 86 | setLocationRelativeTo(frame); |
| 87 | setVisible(true); |
| 88 | requestFocus(); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | public void paint(Graphics g) { |
nothing calls this directly
no test coverage detected