Re: [fpc-pascal] Write Applet with FPC JVM

2016-04-03 Thread Ingemar Ragnemalm



Message: 1
Date: Sat, 2 Apr 2016 03:39:41 -0700 (MST)
From: leledumbo <leledumbo_c...@yahoo.co.id>
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Write Applet with FPC JVM
Message-ID: <1459593581645-5724733.p...@n5.nabble.com>
Content-Type: text/plain; charset=us-ascii


It compiles with both Java and FPC, but the FPC version doesn't run.

Works fine here:
fpc-helloworld-applet.png
<http://free-pascal-general.1045716.n5.nabble.com/file/n5724733/fpc-helloworld-applet.png>


Any ideas? Any obvious mistakes of mine?

I change your program to a unit, though I don't think that matters as long
as HelloWorldApplet.class is generated. Then I modify your applet tag by
removing archive attribute as it's not in a .jar but a standalone .class.
That's it.


Great! I tried and indeed, compiling a unit did it! Editing the HTML 
file didn't seem to matter though.



/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Write Applet with FPC JVM

2016-04-02 Thread leledumbo
> It compiles with both Java and FPC, but the FPC version doesn't run. 

Works fine here:
fpc-helloworld-applet.png

  

> Any ideas? Any obvious mistakes of mine?

I change your program to a unit, though I don't think that matters as long
as HelloWorldApplet.class is generated. Then I modify your applet tag by
removing archive attribute as it's not in a .jar but a standalone .class.
That's it.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Write-Applet-with-FPC-JVM-tp5724727p5724733.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Write Applet with FPC JVM

2016-04-01 Thread Ingemar Ragnemalm


Hello, FPC list!

Is there anyone who knows how to write a JVM applet with FPC?

I have this minimal Java applet:

import java.applet.*;

import java.awt.*;

public class HelloWorldApplet extends Applet

{

   public void paint (Graphics g)

   {

  g.drawString ("Hello World", 25, 50);

   }

}


AFAIK this translates to:

{$mode objfpc}

// I try to make an Applet. How?

program HelloWorldAppletProgram;

uses

jdk15;

type

HelloWorldApplet = class(JAApplet)

public

procedure paint(g: JAGraphics);override;

end;




procedure HelloWorldApplet.paint(g: JAGraphics);

begin

g.drawString('Hello World (FPC)',25,50);

end;

begin

end.


Compiles, produces HelloWorldAppletProgram.class and HelloWorldApplet.class.

FPC compilation line:

/usr/local/bin/ppcjvm -O2 -g HelloWorldAppletProgram.pas -XP 
-FD/usr/local/bin/


Java compilation line:

/usr/bin/javac HelloWorldApplet.java

Uses this HTML file:

HelloWorldApplet



Should IMHO run with

appletviewer HelloWorldApplet.html

It compiles with both Java and FPC, but the FPC version doesn't run.

Any ideas? Any obvious mistakes of mine?


/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal