View Javadoc
1 /* 2 * MythSim 3 * 4 * Copyright (C) 2002-2004 Jason Vroustouris <jasonv@jasonv.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 package org.mythsim.swing; 22 23 import javax.swing.*; 24 import java.awt.*; 25 import java.awt.event.*; 26 import org.mythsim.swing.*; 27 import java.io.*; 28 29 /*** 30 * The About Dialog. 31 * @author Jason Vroustouris 32 */ 33 class MainAboutJDialog 34 extends JDialog 35 implements ActionListener { 36 /*** Create and display About Dialog. **/ 37 public MainAboutJDialog(JFrame f) { 38 super(f, "About MythSim", true); 39 //setSize(500, 300); 40 //setLocation(100, 100); 41 // Size Frame 42 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 43 Dimension frameSize = new Dimension( (int) (450), (int) (200)); 44 int x = (int) (screenSize.width / 2 - frameSize.width / 2); 45 int y = (int) (screenSize.height / 2 - frameSize.height / 2); 46 setBounds(x, y, frameSize.width, frameSize.height); 47 48 String text = MythSimSwing.version_title + " - http://www.mythsim.org/\n" + 49 "\n" + 50 "Copyright (C) 2002-2004 Jason Vroustouris <jasonv@jasonv.com>\n" + 51 "\n" + 52 "This program is free software; you can redistribute it and/or modify\n" + 53 "it under the terms of the GNU General Public License as published by\n" + 54 "the Free Software Foundation; either version 2 of the License, or\n" + 55 "(at your option) any later version.\n" + 56 "\n" + 57 "This program is distributed in the hope that it will be useful,\n" + 58 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + 59 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + 60 "GNU General Public License for more details.\n" + 61 "\n" + 62 "You should have received a copy of the GNU General Public License\n" + 63 "along with this program; if not, write to the Free Software\n" + 64 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" + 65 "\n" + 66 "" + 67 "MythSim 3.0: A Mythical Simulator for Real Students\n" + 68 "CS398 Undergraduate Research\n" + 69 "for Professor Mitch Theys\n" + 70 "by Jason Vroustouris\n" + 71 "University of Illinois at Chicago\n" + 72 "Department of Computer Science\n" + 73 "December 19, 2003\n" + 74 "\n" + 75 "Mythsim 1.0: A Detailed Computer Architecture Simulator\n" + 76 "EECS 597 Master's Project\n" + 77 "for Professor Jon Solworth\n" + 78 "by Rolf Hettelsater\n" + 79 "University of Illinois at Chicago\n" + 80 "Department of Electrical Engineering and Computer Science\n" + 81 "September 26, 1997\n"; 82 83 JTextPane jTextPane = new JTextPane(); 84 jTextPane.setText(text); 85 jTextPane.setEditable(false); 86 jTextPane.setSelectionColor(Color.WHITE); 87 jTextPane.select(0, 1); 88 JButton jButton = new JButton("Ok"); 89 jButton.addActionListener(this); 90 getContentPane().setLayout(new BorderLayout()); 91 getContentPane().add(new JScrollPane(jTextPane), BorderLayout.CENTER); 92 getContentPane().add(jButton, BorderLayout.SOUTH); 93 show(); 94 95 } 96 97 /*** Handel ActionEvents from the OK JButton **/ 98 public void actionPerformed(ActionEvent a) { 99 dispose(); 100 } 101 }

This page was automatically generated by Maven