Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Sysepub - SysepubGUI.java

SysepubGUI.java

Caricato da: Teutoburgo
Scarica il programma completo

  1. /*
  2.     Sysepub 0.9.0 - A Symmetric Semi-Public key cipher
  3.     Copyright (C) 2002 Pierre Blanc
  4.     Pierre Blanc: blanc_teutoburgo@yahoo.it
  5.     http://teutoburgo.cjb.net
  6.     http://it.geocities.com/teutoburgo
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 2 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.     or go to      http://www.gnu.org/copyleft/gpl.html
  22. */
  23. import javax.swing.UIManager;
  24. import java.awt.*;
  25.  
  26. public class SysepubGUI {
  27.   boolean packFrame = false;
  28.  
  29.   /**Construct the application*/
  30.   public SysepubGUI() {
  31.     FrameSysepub frame = new FrameSysepub();
  32.     //Validate frames that have preset sizes
  33.     //Pack frames that have useful preferred size info, e.g. from their layout
  34.     if (packFrame) {
  35.       frame.pack();
  36.     }
  37.     else {
  38.       frame.validate();
  39.     }
  40.     //Center the window
  41.     Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  42.     Dimension frameSize = frame.getSize();
  43.     if (frameSize.height > screenSize.height) {
  44.       frameSize.height = screenSize.height;
  45.     }
  46.     if (frameSize.width > screenSize.width) {
  47.       frameSize.width = screenSize.width;
  48.     }
  49.     frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
  50.     frame.setVisible(true);
  51.   }
  52.   /**Main method*/
  53.   public static void main(String[] args) {
  54.     try {
  55.       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  56.     }
  57.     catch(Exception e) {
  58.       e.printStackTrace();
  59.     }
  60.     new SysepubGUI();
  61.   }
  62. }