()
| 30 | JTable table; |
| 31 | |
| 32 | @SuppressWarnings("deprecation") |
| 33 | FontResizeBug() { |
| 34 | menuBar = new JMenuBar(); |
| 35 | frame.getRootPane().setMenuBar(menuBar); |
| 36 | // font menu |
| 37 | JMenu fontMenu = new JMenu("Font Test"); //$NON-NLS-1$ |
| 38 | menuBar.add(fontMenu); |
| 39 | JMenuItem sizeUpItem = new JMenuItem("Increase"); //$NON-NLS-1$ |
| 40 | sizeUpItem.addActionListener(new ActionListener() { |
| 41 | public void actionPerformed(ActionEvent e) { |
| 42 | FontSizer.levelUp(); |
| 43 | } |
| 44 | |
| 45 | }); |
| 46 | fontMenu.add(sizeUpItem); |
| 47 | |
| 48 | table = new JTable(data, columnNames); |
| 49 | |
| 50 | FontSizer.setFonts(table, FontSizer.getLevel()); |
| 51 | FontSizer.addPropertyChangeListener("level", new PropertyChangeListener() { //$NON-NLS-1$ |
| 52 | public void propertyChange(PropertyChangeEvent e) { |
| 53 | int level = ((Integer) e.getNewValue()).intValue(); |
| 54 | FontSizer.setFonts(menuBar, level); |
| 55 | FontSizer.setFonts(table, level); |
| 56 | } |
| 57 | |
| 58 | }); |
| 59 | |
| 60 | frame.setContentPane(table); |
| 61 | frame.setSize(500, 500); |
| 62 | frame.setVisible(true); |
| 63 | } |
| 64 | |
| 65 | public static void main(String[] args) { |
| 66 | new FontResizeBug(); |
nothing calls this directly
no test coverage detected