Hello world/Grafici (browser)

Wikibooks, manuali e libri di testo liberi.
Jump to navigation Jump to search

Di seguito sono illustrati esempi di Hello world eseguiti su interfacce grafiche su browser.

Curl[modifica]

{curl  (Version)applet}
Hello world

Java applet[modifica]

Java applet funzionano in collegamento con HTML.

import java.applet.*;
import java.awt.*;

public class HelloWorld extends Applet {
  public void paint(Graphics g) {
    g.drawString("Hello World!", 100, 50);
  }
}

Codice HTML per vedere l'Applet con un Browser.

<object classid="java:HelloWorld.class"
        codetype="application/java-vm"
        width="600" height="100">
</object>

JavaScript, alias ECMAScript[modifica]

<script type="text/javascript">
   alert("Hello World!");
</script>

Oppure:

<script type="text/javascript">
   document.write("Hello World!");
</script>

VBScript[modifica]

<script language="VBScript">
    MsgBox "Hello World!"
</script>

XUL[modifica]

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <box align="center">
   <label value="Hello World!" />
 </box>
</window>

XAML[modifica]

<?Mapping ClrNamespace="System" Assembly="mscorlib" XmlNamespace=" http://www.gotdotnet.com/team/dbox/mscorlib/System" ?>
<Object xmlns=" http://www.gotdotnet.com/team/dbox/mscorlib/System" xmlns:def="Definition" def:Class="MyApp.Hello">
    <def:Code>
    <![CDATA[
     Shared Sub Main()
     '{
         System.Console.WriteLine("Hello World!")' ;
     '}
     End Sub
    ]]>
    </def:Code>
</Object>