Image tmpImg = ((J2SEDevice) DeviceFactory.getDevice()).getNormalImage(); Dimension size = new Dimension(tmpImg.getWidth(null), tmpImg.getHeight(null)); size.width += 10; size.height += statusBar.getPreferredSize().height + 55; setSize(size);
  Main()  {    instance = this;        JMenuBar menuBar = new JMenuBar();        JMenu menuFile = new JMenu("File");        menuOpenJADFile = new JMenuItem("Open JAD File...");    menuOpenJADFile.addActionListener(menuOpenJADFileListener);    menuFile.add(menuOpenJADFile);    menuOpenJADURL = new JMenuItem("Open JAD URL...");    menuOpenJADURL.addActionListener(menuOpenJADURLListener);    menuFile.add(menuOpenJADURL);        menuFile.addSeparator();        JMenuItem menuItem = new JMenuItem("Exit");    menuItem.addActionListener(menuExitListener);    menuFile.add(menuItem);        JMenu menuOptions = new JMenu("Options");        JMenuItem menuSelectDevice = new JMenuItem("Select device...");    menuSelectDevice.addActionListener(menuSelectDeviceListener);    menuOptions.add(menuSelectDevice);    menuBar.add(menuFile);    menuBar.add(menuOptions);    setJMenuBar(menuBar);        setTitle("MicroEmulator");        Config.loadConfig();    addKeyListener(keyListener);    devicePanel = new SwingDeviceComponent();    selectDevicePanel = new SelectDevicePanel();    setDevice(selectDevicePanel.getSelectedDeviceEntry());        launcher = new Launcher();    launcher.setCurrentMIDlet(launcher);         getContentPane().add(devicePanel, "Center");    getContentPane().add(statusBar, "South");        Image tmpImg = ((J2SEDevice) DeviceFactory.getDevice()).getNormalImage();    Dimension size = new Dimension(tmpImg.getWidth(null), tmpImg.getHeight(null));    size.width += 10;    size.height += statusBar.getPreferredSize().height + 55;    setSize(size);    initialized = true;  }