summaryrefslogtreecommitdiff
path: root/src/TestApplet.java
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-27 10:52:05 +0000
committerPixel <Pixel>2001-11-27 10:52:05 +0000
commit29f8cedf68c5e45ca20078a2a34a07875d7dea5b (patch)
treea9c5a77cc19d8addc8e79166c2c62f5d7f3b0bde /src/TestApplet.java
parent3baa9d168c02a8734b95d1cc467601b6aaf2f6e4 (diff)
HelloJava removed
Diffstat (limited to 'src/TestApplet.java')
-rw-r--r--src/TestApplet.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/TestApplet.java b/src/TestApplet.java
new file mode 100644
index 0000000..cba1811
--- /dev/null
+++ b/src/TestApplet.java
@@ -0,0 +1,25 @@
+import javax.swing.*; //This is the final package name.
+//import com.sun.java.swing.*; //Used by JDK 1.2 Beta 4 and all
+ //Swing releases before Swing 1.1 Beta 3.
+import java.awt.*;
+
+public class TestApplet extends JApplet {
+
+ // This is a hack to avoid an ugly error message in 1.1.
+ public TestApplet() {
+ getRootPane().putClientProperty("defeatSystemEventQueueCheck",
+ Boolean.TRUE);
+ }
+
+ public void init() {
+ JLabel label = new JLabel(
+ "You are successfully running a Swing applet!");
+ label.setHorizontalAlignment(JLabel.CENTER);
+
+ //Add border. Should use createLineBorder, but then the bottom
+ //and left lines don't appear -- seems to be an off-by-one error.
+ label.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black));
+
+ getContentPane().add(label, BorderLayout.CENTER);
+ }
+}