001 package net.provision.soap; 002 003 import java.awt.*; 004 import java.awt.event.*; 005 006 import java.util.*; 007 008 import javax.swing.*; 009 010 011 /** 012 * DOCUMENT ME! 013 * 014 * @author $author$ 015 * @version $Revision$ 016 */ 017 public class About extends JFrame { 018 private JButton bugBTN; 019 private JButton okBTN; 020 private JButton proBTN; 021 private JLabel bugLabel; 022 private JLabel label; 023 private JLabel proLabel; 024 025 public About() { 026 Container c = getContentPane(); 027 c.setLayout(new GridBagLayout()); 028 029 Calendar cal = Calendar.getInstance(); 030 okBTN = new JButton("OK"); 031 032 proBTN = new JButton( 033 "<html><a href=\"http://www.provisiontech.net/\">http://www.provisiontech.net/</a></html>"); 034 bugBTN = new JButton( 035 "<html><a href=\"http://bugs.provisiontech.net/\">http://bugs.provisiontech.net/</a></html>"); 036 037 //remove border from buttons 038 proBTN.setBorderPainted(false); 039 proBTN.setMargin(new Insets(0, 0, 0, 0)); 040 proBTN.setFocusPainted(false); 041 bugBTN.setBorderPainted(false); 042 bugBTN.setMargin(new Insets(0, 0, 0, 0)); 043 bugBTN.setFocusPainted(false); 044 045 okBTN.addActionListener(new ActionListener() { 046 public void actionPerformed(ActionEvent e) { 047 dispose(); 048 } 049 }); 050 051 proBTN.addActionListener(new ActionListener() { 052 public void actionPerformed(ActionEvent e) { 053 try { 054 BrowserLauncher.openURL("http://www.provisiontech.net"); 055 } catch(java.io.IOException err) { 056 } 057 } 058 }); 059 060 bugBTN.addActionListener(new ActionListener() { 061 public void actionPerformed(ActionEvent e) { 062 try { 063 BrowserLauncher.openURL("http://bugs.provisiontech.net"); 064 } catch(java.io.IOException err) { 065 } 066 } 067 }); 068 069 GridBagConstraints gb = new GridBagConstraints(); 070 071 gb.gridx = 1; 072 gb.gridy = 1; 073 gb.gridwidth = 2; 074 gb.insets = new Insets(10, 10, 10, 10); //top, left, bottom, right 075 076 //gb.gridwidth = 1; 077 //gb.gridheight = 1; 078 //gb.fill = GridBagConstraints.BOTH; 079 //gb.gridwidth = GridBagConstraints.REMAINDER; 080 c.add(new JLabel("<html><center><hr>SOAP v.01 (BETA)<br>" + 081 "Copyright © 2004 - " + cal.get(Calendar.YEAR) + " Provision Tech<br>" + 082 "Author: Brett Batie<br>" + "All Rights Reserved.<br>" + 083 "This release is freeware</center><hr><br>" + "</html>"), gb); 084 085 gb.gridy = 2; 086 gb.gridx = 1; 087 gb.gridwidth = 1; 088 c.add(new JLabel("Homepage:"), gb); 089 090 gb.gridx = 2; 091 c.add(proBTN, gb); 092 093 gb.gridy = 3; 094 gb.gridx = 1; 095 c.add(new JLabel("Submit Bug:"), gb); 096 097 gb.gridx = 2; 098 c.add(bugBTN, gb); 099 100 gb.gridy = 4; 101 gb.gridx = 1; 102 gb.gridwidth = 2; 103 gb.fill = GridBagConstraints.BOTH; 104 gb.insets = new Insets(0, 0, 0, 0); 105 c.add(okBTN, gb); 106 107 pack(); 108 109 Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); 110 int y = (d.height / 2) - (getHeight() / 2); 111 setLocation((d.width / 2) - (getWidth() / 2), y); 112 113 setTitle("SOAP - created by Brett Batie"); 114 setDefaultCloseOperation(DISPOSE_ON_CLOSE); 115 setVisible(true); 116 setResizable(false); 117 } 118 }