Converting Applets to Applications
You can compare the code of this application with that of Dharmesh Tailor's original applet and see that we have made additions without changing any of his code. We have added javax.swing (for the JFrame to contain an object of the existing applet class) to the uses clause, declared the Main method in the interface section, then coded the Main method at the end of the program. We must call the init and start methods of the applet (which are normally called by the browser). The browsers installed on the Raspberry Pi are not yet Java-enabled, but we can run the application on the Pi with the java program in the open JDK:

Java application (from applet) running on the Pi
We needed to set the OutputType to Executable in the .oxygene project file to obtain this jar file.
See below the Oxygene code and the equivalent code in RemObjects C#.
Oxygene code
namespace mouse_application; { Original applet to demonstrate mouse event handlers Copyright (c) 2012 Dharmesh Tailor Converted from applet to application by PPS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License, as described at http://www.apache.org/licenses/ and http://www.pp4s.co.uk/licenses/ } interface uses java.applet.*, java.awt, java.awt.event, javax.swing; type MouseApplet = public class(Applet, MouseListener, MouseMotionListener) private var msg : String := ''; //Coordinates of mouse var mouseX : Integer := 0; var mouseY : Integer := 0; public method init; override; method mouseClicked(me : MouseEvent); method mouseEntered(me : MouseEvent); method mouseExited(me : MouseEvent); method mousePressed(me : MouseEvent); method mouseReleased(me : MouseEvent); method mouseDragged(me : MouseEvent); method mouseMoved(me : MouseEvent); method paint(g : Graphics); override; end; ConsoleApp = class public class method Main(args : array of String); end; implementation method MouseApplet.init; begin Background := Color.gray; addMouseListener(self); addMouseMotionListener(self); end; method MouseApplet.mouseClicked(me : MouseEvent); begin mouseX := 0; mouseY := 10; msg := 'Mouse clicked.'; repaint; end; method MouseApplet.mouseEntered(me : MouseEvent); begin mouseX := 0; mouseY := 10; msg := 'Mouse entered.'; repaint; end; method MouseApplet.mouseExited(me : MouseEvent); begin mouseX := 0; mouseY := 10; msg := 'Mouse exited.'; repaint; end; method MouseApplet.mousePressed(me : MouseEvent); begin mouseX := me.X; mouseY := me.Y; msg := 'Down'; repaint; end; method MouseApplet.mouseReleased(me : MouseEvent); begin mouseX := me.X; mouseY := me.Y; msg := 'Up'; repaint; end; method MouseApplet.mouseDragged(me : MouseEvent); begin mouseX := 0; mouseY := 10; msg := 'Dragging mouse at ' + me.X + ', ' + me.Y; repaint; end; method MouseApplet.mouseMoved(me : MouseEvent); begin end; method MouseApplet.paint(g : Graphics); begin g.drawString(msg, mouseX, mouseY); end; class method ConsoleApp.Main(args : array of String); begin var AppletFrame : JFrame := new JFrame('Mouse Application'); var MyMouseApplet : MouseApplet := new MouseApplet; AppletFrame.add("Center", MyMouseApplet); AppletFrame.setSize(300, 200); AppletFrame.setVisible(True); AppletFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyMouseApplet.init; MyMouseApplet.start; end; end.
RemObjects C# Version of mouse_application
using java.util; using java.applet; using java.awt; using java.awt.@event; using javax.swing; namespace mouse_application_cs /* Original applet to demonstrate mouse event handlers Copyright (c) 2012 Dharmesh Tailor Converted from applet to application then to RemObjects C# by PPS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License, as described at http://www.apache.org/licenses/ and http://www.pp4s.co.uk/licenses/ */ { public class MouseApplet: Applet, MouseListener, MouseMotionListener { private String msg = ""; //Coordinates of mouse Integer mouseX = 0; Integer mouseY = 0; public override void init() { Background = Color.gray; addMouseListener(this); addMouseMotionListener(this); } public void mouseClicked(MouseEvent me) { mouseX = 0; mouseY = 10; msg = "Mouse clicked."; repaint(); } public void mouseEntered(MouseEvent me) { mouseX = 0; mouseY = 10; msg = "Mouse entered."; repaint(); } public void mouseExited(MouseEvent me) { mouseX = 0; mouseY = 10; msg = "Mouse exited."; repaint(); } public void mousePressed(MouseEvent me) { mouseX = me.X; mouseY = me.Y; msg = "Down"; repaint(); } public void mouseReleased(MouseEvent me) { mouseX = me.X; mouseY = me.Y; msg = "Up"; repaint(); } public void mouseDragged(MouseEvent me) { mouseX = 0; mouseY = 10; msg = "Dragging mouse at " + me.X + ", " + me.Y; repaint(); } public void mouseMoved(MouseEvent me) { } public override void paint(Graphics g ) { g.drawString(msg, mouseX, mouseY); } } static class ConsoleApp { public static void Main(string[] args) { JFrame AppletFrame = new JFrame("Mouse Application"); MouseApplet MyMouseApplet = new MouseApplet(); AppletFrame.add("Center", MyMouseApplet); AppletFrame.setSize(300, 200); AppletFrame.setVisible(true); AppletFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyMouseApplet.init(); MyMouseApplet.start(); } } }