Update of /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer
In directory sc8-pr-cvs1:/tmp/cvs-serv32392/de/cgarbs/apps/jprojecttimer
Modified Files:
MainWindow.java
Added Files:
AboutWindow.java
Log Message:
About dialog upgraded to a full window with more information.
--- NEW FILE: AboutWindow.java ---
/*
* $Id: AboutWindow.java,v 1.1 2002/11/23 21:32:38 mastermitch Exp $
*
* 2002 (C) by Christian Garbs <mi...@cg...>
*
* Licensed under GNU GPL (see COPYING for details)
*
*/
package de.cgarbs.apps.jprojecttimer;
import de.cgarbs.util.Configuration;
import de.cgarbs.util.Resource;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ImageIcon;
/** @author Christian Garbs <mi...@cg...>
* @version $Id: AboutWindow.java,v 1.1 2002/11/23 21:32:38 mastermitch Exp $
*/
class AboutWindow extends JFrame implements ActionListener
{
static AboutWindow alreadyOpen = null;
private JButton ok = null;
public AboutWindow()
{
super(Resource.get("aboutJProjectTimer"));
if (alreadyOpen == null) {
alreadyOpen = this;
String text = Configuration.get("copyright") + "\n";
for (int i=0; i < Integer.parseInt(Configuration.get("copyright_count")); i++) {
text += Configuration.get("copyright_"+i) + "\n";
}
text += "\n";
text += Resource.get("language") + ": " + Resource.get("LANGUAGE") + "\n";
text += Resource.get("translator") + ": " + Resource.get("MAINTAINER") + "\n";
ok = new JButton(Resource.get("okButton"));
ok.addActionListener(this);
getContentPane().add(new JLabel(Configuration.get("name") + " " + Configuration.get("version"),
new ImageIcon (this.getClass().getResource("/jptlogo.gif")),
JLabel.CENTER),
BorderLayout.NORTH);
getContentPane().add(new JScrollPane(new JTextArea(text)),
BorderLayout.CENTER);
getContentPane().add(ok,
BorderLayout.SOUTH);
pack();
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setVisible(true);
} else {
alreadyOpen.setVisible(true);
dispose();
}
}
public void actionPerformed(ActionEvent e)
{
setVisible(false);
dispose();
alreadyOpen = null;
}
}
Index: MainWindow.java
===================================================================
RCS file: /cvsroot/jprojecttimer/jprojecttimer/de/cgarbs/apps/jprojecttimer/MainWindow.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MainWindow.java 4 Nov 2002 12:42:15 -0000 1.9
--- MainWindow.java 23 Nov 2002 21:32:38 -0000 1.10
***************
*** 29,33 ****
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
- import javax.swing.ImageIcon;
--- 29,32 ----
***************
*** 251,259 ****
public void performAbout()
{
! JOptionPane.showMessageDialog(null,
! "JProjectTimer V0.0.7", "JProjectTimer",
! JOptionPane.INFORMATION_MESSAGE,
! new ImageIcon (this.getClass().getResource("/jptlogo.gif")));
!
}
}
--- 250,254 ----
public void performAbout()
{
! new AboutWindow();
}
}
|