void (ActionEvent e) { try{ UIManager.setLookAndFeel(myInfo.getClassName()); SwingUtilities.updateComponentTreeUI(myFrame); Dimension prefSize = myFrame.getPreferredSize(); if(prefSize.width > myFrame.getWidth() || prefSize.height > myFrame.getHeight()){ myFrame.pack(); } } catch(Exception exc){ JOptionPane.showMessageDialog( myFrame, MessageFormat.format(ourBundle.getString("error.cannot.change.look.feel"), exc.getMessage()), ourBundle.getString("error.title"), JOptionPane.ERROR_MESSAGE ); } }