From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- stoc/test/javavm/testapplet/TestApplet.html | 19 +++++++++++ stoc/test/javavm/testapplet/TestApplet.java | 53 +++++++++++++++++++++++++++++ stoc/test/javavm/testapplet/makefile.mk | 43 +++++++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 stoc/test/javavm/testapplet/TestApplet.html create mode 100644 stoc/test/javavm/testapplet/TestApplet.java create mode 100644 stoc/test/javavm/testapplet/makefile.mk (limited to 'stoc/test/javavm/testapplet') diff --git a/stoc/test/javavm/testapplet/TestApplet.html b/stoc/test/javavm/testapplet/TestApplet.html new file mode 100644 index 000000000..e83d2ffe7 --- /dev/null +++ b/stoc/test/javavm/testapplet/TestApplet.html @@ -0,0 +1,19 @@ + + + + + A Clock (1.1) + + + + + +

TestApplet

+
+

+ + +

+ + + \ No newline at end of file diff --git a/stoc/test/javavm/testapplet/TestApplet.java b/stoc/test/javavm/testapplet/TestApplet.java new file mode 100644 index 000000000..e271f4dd1 --- /dev/null +++ b/stoc/test/javavm/testapplet/TestApplet.java @@ -0,0 +1,53 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +import java.awt.Color; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.net.MalformedURLException; + +public class TestApplet extends java.applet.Applet { + + /** Initialization method that will be called after the applet is loaded + * into the browser. + */ + @Override + public void init () { + setBackground( Color.green); + resize( 300, 300); + + // Security tests. + File f= new File("d:\\temp\\javasecurity.txt"); + try { + f.createNewFile(); + + // local connection + URL url= new URL("http://localhost:8080/index.html"); + url.openStream(); + // remote connection + url= new URL("http://www.w3.org/index.html"); + url.openStream(); + }catch( MalformedURLException mue) { + }catch( IOException e) { + String s= e.getMessage(); + System.out.println(s); + } + + } +} diff --git a/stoc/test/javavm/testapplet/makefile.mk b/stoc/test/javavm/testapplet/makefile.mk new file mode 100644 index 000000000..c2b5a2001 --- /dev/null +++ b/stoc/test/javavm/testapplet/makefile.mk @@ -0,0 +1,43 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +PRJ=..$/..$/.. + +PRJNAME = testapplet +PACKAGE = +TARGET = TestApplet + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# Files -------------------------------------------------------- + +JARFILES = ridl.jar jurt.jar unoil.jar + +JAVAFILES= $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES))) + + +JAVACLASSFILES= \ + $(CLASSDIR)$/$(PACKAGE)$/TestApplet.class + +JARCLASSDIRS= . + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk -- cgit v1.2.3