settings.setIntegerProperty( "render.width.pixels", (int) widthField.getValue()); settings.setIntegerProperty( "render.height.pixels", (int) heightField.getValue());
int widthPixels; int heightPixels;  int units_from; ; double factor;   units_from = widthUnits.getSelectedIndex();  factor = getConversionFactor( units_from, units_to, resolution, resolution_units);  widthPixels = (int) (width * factor);   units_from = heightUnits.getSelectedIndex();  factor = getConversionFactor( units_from, units_to, resolution, resolution_units);  heightPixels = (int) (height * factor);   settings.setDoubleProperty("render.width", width); settings.setIntegerProperty("render.width.pixels", widthPixels); settings.setProperty( "render.width.units", (String) widthUnits.getSelectedItem());   settings.setDoubleProperty("render.height", height); settings.setIntegerProperty("render.height.pixels", heightPixels); settings.setProperty( "render.height.units", (String) heightUnits.getSelectedItem());   settings.setDoubleProperty("render.resolution", resolution); settings.setProperty( "render.resolution.units", (String) resolutionUnitsBox.getSelectedItem());
   boolean showOptions()   {      int result =         JOptionPane.showOptionDialog(            null,            new Object[] { createRenderOptionsPanel()},            "Settings",            JOptionPane.OK_CANCEL_OPTION,            JOptionPane.PLAIN_MESSAGE,            null,            null,            null);      if (result == JOptionPane.CANCEL_OPTION)      {         return false;      }      //      settings.setDoubleProperty("render.width", widthField.getValue());      //      settings.setDoubleProperty("render.height", heightField.getValue());      settings.setIntegerProperty(         "render.width.pixels",         (int) widthField.getValue());      settings.setIntegerProperty(         "render.height.pixels",         (int) heightField.getValue());      try      {         settings.storeProperties();      }      catch (Exception e)      {         System.err.println("Error storing new settings");      }      return true;   }