]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Start introducing detached ui
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 3 Oct 2008 08:44:19 +0000 (08:44 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 3 Oct 2008 08:44:19 +0000 (08:44 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1691 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

sandbox/argeo.slc.testui/.classpath
sandbox/argeo.slc.testui/src/main/java/org/argeo/slc/testui/SwingTestUi.java

index 71840c6c6aff04de50f924ed6d183f38d8610167..b5ee620f1b3873fbfe23f61890b04c1f04e08e96 100644 (file)
@@ -4,6 +4,6 @@
        <classpathentry kind="src" path="src/test/java"/>
        <classpathentry kind="src" path="src/test/resources"/>
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="output" path="bin"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.3.1_20"/>
+       <classpathentry kind="output" path="target/classes"/>
 </classpath>
index c02891bb3506ea0d6ad729720d5ca14a30ca48b6..efaf6e96e6a0b60ac7c100be9132b3a3dcb6580e 100644 (file)
@@ -5,17 +5,18 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
 import javax.swing.JButton;
+import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 
 public class SwingTestUi {
        private static void createAndShowGUI(boolean exitOnClose) {
                // Create and set up the window.
-               JFrame frame = new JFrame("HelloWorldSwing");
+               final JFrame frame = new JFrame("HelloWorldSwing");
                if (exitOnClose)
                        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
-               frame.getContentPane().setLayout(new GridLayout(2, 1));
+               frame.getContentPane().setLayout(new GridLayout(3, 1));
 
                // Add the ubiquitous "Hello World" label.
                final JLabel label = new JLabel("Hello World");
@@ -32,6 +33,18 @@ public class SwingTestUi {
                        }
                });
 
+               final JButton buttonStart = new JButton("Start");
+               frame.getContentPane().add(buttonStart);
+               buttonStart.addActionListener(new ActionListener() {
+                       public void actionPerformed(ActionEvent e) {
+                               JDialog dialog = new JDialog(frame, "TestDialog");
+                               JLabel label = new JLabel("Dialog open");
+                               dialog.getContentPane().add(label);
+                               dialog.pack();
+                               dialog.setVisible(true);
+                       }
+               });
+
                // Display the window.
                frame.pack();
                frame.setVisible(true);