[Zerofile-svn] SF.net SVN: zerofile: [19] trunk/src
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <kar...@us...> - 2007-11-06 10:13:57
|
Revision: 19
http://zerofile.svn.sourceforge.net/zerofile/?rev=19&view=rev
Author: karl-bengtsson
Date: 2007-11-06 02:14:00 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
*) Changed the ZeroFileMainWindow class from inheriting from JFrame to being a static class with class methods instantiating all the required GUI components. This is cleaner.
*) Added some comments for Javadoc
*) Removed deprecated stuff from the main ZeroFile.java file
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-05 15:55:17 UTC (rev 18)
+++ trunk/src/ZeroFile.java 2007-11-06 10:14:00 UTC (rev 19)
@@ -5,11 +5,10 @@
public class ZeroFile {
/**
- * @param args
+ * @param name - The service name used by the registration class. Deprecated. Don't use.
*/
public static void main(String[] args) {
- ZeroFileMainWindow Huvudfonster = new ZeroFileMainWindow();
- Huvudfonster.setVisible(true);
+ ZeroFileMainWindow.startMainWindow();
ZeroFileSettingsWindow Settingsfonster = new ZeroFileSettingsWindow();
if (args.length > 1)
{
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-05 15:55:17 UTC (rev 18)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 10:14:00 UTC (rev 19)
@@ -1,13 +1,14 @@
-// The class defining the main GUI window
-
import java.awt.*;
import javax.swing.*;
-public class ZeroFileMainWindow extends JFrame implements java.io.Serializable
+public class ZeroFileMainWindow
{
- static final long serialVersionUID = -5208364155946320552L;
- public ZeroFileMainWindow ()
+ /**
+ * @author Karl Bengtsson
+ */
+ static void startMainWindow()
{
+ JFrame mainWindowFrame = new JFrame();
JMenuBar mainMenuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
mainMenuBar.add(fileMenu);
@@ -15,11 +16,12 @@
fileMenu.add(settingsMenuItem);
JMenuItem quitMenuItem = new JMenuItem("Quit");
fileMenu.add(quitMenuItem);
- this.setLayout(new GridLayout(0,1,1,1));
- this.setMinimumSize(new Dimension(120,300));
- this.setSize(new Dimension(150,400));
- this.setJMenuBar(mainMenuBar);
+ mainWindowFrame.setLayout(new GridLayout(0,1,1,1));
+ mainWindowFrame.setMinimumSize(new Dimension(120,300));
+ mainWindowFrame.setSize(new Dimension(150,400));
+ mainWindowFrame.setJMenuBar(mainMenuBar);
for (int i = 0; i<12; i++)
- this.add(new JButton("Button #"+i));
+ mainWindowFrame.add(new JButton("Button #"+i));
+ mainWindowFrame.setVisible(true);
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|