Code example for Logger

Methods: fine, warning

0
        final JRadioButtonMenuItem item = (JRadioButtonMenuItem) e.getSource();
        final String text = item.getText();
 
        try { 
            final int ms = Integer.parseInt(text);
            logger.fine("interval: "+ ms);
 
            final LifeFrame frame = Life.getInstance().getFrame();
            final LifePanel panel = (LifePanel) frame.getContentPane();
            final Timer timer = panel.getTimer();
            timer.setDelay(ms);
            timer.setInitialDelay(ms);
        } catch (NumberFormatException ex) {
            logger.warning(ex.toString());
        } 
    } 
}