001: /*
002: * Created on May 15, 2004
003: *
004: * To change the template for this generated file go to
005: * Window>Preferences>Java>Code Generation>Code and Comments
006: */
007: package com.pk;
008:
009: import java.awt.BorderLayout;
010: import java.awt.Dimension;
011: import java.awt.event.ActionEvent;
012: import java.awt.event.ActionListener;
013:
014: import javax.swing.BoxLayout;
015: import javax.swing.ImageIcon;
016: import javax.swing.JButton;
017: import javax.swing.JDialog;
018: import javax.swing.JLabel;
019: import javax.swing.JOptionPane;
020: import javax.swing.JPanel;
021: import javax.swing.JSeparator;
022: import javax.swing.SwingConstants;
023:
024: /**
025: * @author Isabelle
026: *
027: * To change the template for this generated type comment go to
028: * Window>Preferences>Java>Code Generation>Code and Comments
029: */
030: public class AboutPanel extends JPanel implements ActionListener {
031: /**
032: *
033: */
034: private static final long serialVersionUID = 179927281520551276L;
035: private JDialog jDialog = null;
036: private JButton okJButton = null;
037: private JButton aboutPKJButton = null;
038:
039: /**
040: *
041: */
042: public AboutPanel(JDialog argJDialog) {
043: super ();
044: jDialog = argJDialog;
045: init();
046: }
047:
048: /**
049: * @param arg0
050: */
051: private void init() {
052: ImageIcon tmpImageIcon = new ImageIcon("images/yoda.gif");
053: JPanel topPanel = new JPanel();
054: JPanel bottumPanel = new JPanel();
055: JLabel spaceLable = new JLabel(" ");
056: spaceLable.setMaximumSize(new Dimension(10, 10));
057: JLabel tmpJLabel = new JLabel(
058: "<html> V2.0 Beta 3 <P>Pklite SQL Client is a modified version of a program<P>called Pretty Kid For more information about Pretty Kid<P>click on the about pretty kid button<p><A href=\"http://pklite.sourceforge.net/\">pklite.sourceforge.net</A>");
059: JLabel imgLabel = new JLabel(tmpImageIcon);
060: okJButton = new JButton("Ok");
061: aboutPKJButton = new JButton("About Pretty Kid");
062:
063: okJButton.addActionListener(this );
064: aboutPKJButton.addActionListener(this );
065:
066: topPanel
067: .setLayout(new BoxLayout(topPanel, BoxLayout.LINE_AXIS));
068: topPanel.add(spaceLable);
069: topPanel.add(imgLabel);
070: topPanel.add(spaceLable);
071: topPanel.add(tmpJLabel);
072:
073: bottumPanel.setLayout(new BorderLayout());
074: bottumPanel.add(aboutPKJButton, BorderLayout.WEST);
075:
076: setLayout(new BoxLayout(this , BoxLayout.PAGE_AXIS));
077: add(topPanel);
078: add(okJButton);
079: add(new JSeparator(SwingConstants.HORIZONTAL));
080: add(bottumPanel);
081: }
082:
083: /* (non-Javadoc)
084: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
085: */
086: public void actionPerformed(ActionEvent arg0) {
087: if (arg0.getSource().equals(okJButton)) {
088: jDialog.dispose();
089: }
090: if (arg0.getSource().equals(aboutPKJButton)) {
091: JOptionPane
092: .showMessageDialog(
093: this ,
094: "(c) Copyright 2001 by Daekyun Lim \nhttp://www.prettykid.com",
095: "About Pretty Kid",
096: JOptionPane.INFORMATION_MESSAGE,
097: new ImageIcon("images/mybaby2.jpg"));
098: }
099:
100: }
101:
102: }
|