示例#1
0
 public static void createAndShowGUI() {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | UnsupportedLookAndFeelException ex) {
     ex.printStackTrace();
   }
   JFrame frame = new JFrame("@title@");
   frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
   frame.getContentPane().add(new MainPanel());
   frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setVisible(true);
 }
 /**
  * Constructs and initializes this object
  *
  * @param viewerPanel the <code>JImageViewerPanel</code> this action is linked to
  * @param imageType
  */
 public ImageViewerPanelSaveAction(JImageViewerPanel viewerPanel, int imageType) {
   super(messagesBundle.getString("ImageViewerPanelSaveAction.Save_1")); // $NON-NLS-1$
   assert viewerPanel != null;
   this.imageType = imageType;
   this.viewerPanel = viewerPanel;
   putValue(
       SHORT_DESCRIPTION,
       messagesBundle.getString("ImageViewerPanelSaveAction.Save_image_to_file_2"));
   //$NON-NLS-1$
   putValue(SMALL_ICON, UIManager.getIcon("FileView.floppyDriveIcon")); // $NON-NLS-1$
 }