Image tmpImg = device.getNormalImage(); Dimension size = new Dimension(tmpImg.getWidth(null), tmpImg.getHeight(null)); size.width += 10; size.height += statusBar.getPreferredSize().height + 55; setSize(size); doLayout();
  public void setDevice(DeviceEntry entry)  {    ProgressJarClassLoader loader =         (ProgressJarClassLoader) devicePanel.getEmulatorContext().getClassLoader();    try {      Class deviceClass = null;      if (entry.getFileName() != null) {        loader.addRepository(            new File(Config.getConfigPath(), entry.getFileName()).toURL());        deviceClass = loader.findClass(entry.getClassName());      } else {        deviceClass = Class.forName(entry.getClassName());      }      J2SEDevice device = (J2SEDevice) deviceClass.newInstance();      DeviceFactory.setDevice(device);      device.init(devicePanel.getEmulatorContext());      devicePanel.init();      this.deviceEntry = entry;    } catch (MalformedURLException ex) {      System.err.println(ex);              } catch (ClassNotFoundException ex) {      System.err.println(ex);              } catch (InstantiationException ex) {      System.err.println(ex);              } catch (IllegalAccessException ex) {      System.err.println(ex);              }  }