[java]applet maken van losse java files

Pagina: 1
Acties:

  • Pkunk
  • Registratie: December 2003
  • Laatst online: 30-04 17:47
Ik heb voor school een tijdje geleden een tekenprogrammatje geschreven in java. Nu wil ik dat op het internet gooien voor bij m'n portfolio. Dan zal ik er dus een applet van moeten maken. Nu denk mijn docent dat ik het compleet zal moeten herschrijven. En omdat hij het niet zeker weet vraag ik het hier toch nog maar even. Is er niet een of ander programma waarmee je gemakkelijk java bestanden (of projecten) om kan zetten naar een applet?

Google heb ik wel geprobeert, maar met zoekacties als "java to applet" of "java project to applet" kom ik niet ver.

Hallo met Tim


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 15-04 22:07

NMe

Quia Ego Sic Dico.

Als je je classes goed hebt opgezet is de weergave van je programma gescheiden van de programmalogica. In dat geval is het omzetten naar een andere manier van weergeven helemaal niet moeilijk: je moet gewoon een andere GUI schrijven die gebruikt maakt van alle methoden in je control class. Als je code niet mooi is opgezet en je bijvoorbeeld alles in dezelfde class doet, dan wordt het een stuk lastiger. ;)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • Nick_S
  • Registratie: Juni 2003
  • Laatst online: 22-04 03:55

Nick_S

++?????++ Out of Cheese Error

Je kan ook eens hier naar kijken:
http://www.oreilly.com/ca...4/StandaloneScribble.java

Wordt je applet in een Applicatie frame geladen.

'Nae King! Nae quin! Nae Laird! Nae master! We willna' be fooled agin!'


  • ronaldmathies
  • Registratie: Juni 2001
  • Niet online
Veel verschil tussen een applicatie en een applet is er niet, je moet in iedergeval ervanuitgaan dat je startpunt ipv je huidige klasse met de method main() moet veranderen in een klasse die de JApplet extends.

vervolgens moet je de volgende methods gebruiken om je applicatie te initialiseren:

public void destroy()
public String getAppletInfo()
public void init()

hier wat documentatie in het engels die ik er ooit bij had gezet:

destroy :

/**
* Called by the browser or applet viewer to inform
* this applet that it is being reclaimed and that it should destroy
* any resources that it has allocated. The <code>stop</code> method
* will always be called before <code>destroy</code>. <p>
*
* A subclass of <code>Applet</code> should override this method if
* it has any operation that it wants to perform before it is
* destroyed. For example, an applet with threads would use the
* <code>init</code> method to create the threads and the
* <code>destroy</code> method to kill them. <p>
*/

getAppletInfo()
/**
* Returns information about this applet. An applet should override
* this method to return a <code>String</code> containing information
* about the author, version, and copyright of the applet. <p>
*
* @return a string containing information about the author, version, and
* copyright of the applet.
*/

init()
/**
* Called by the browser or applet viewer to inform
* this applet that it has been loaded into the system. It is always
* called before the first time that the <code>start</code> method is
* called. <p>
*
* A subclass of <code>Applet</code> should override this method if
* it has initialization to perform. For example, an applet with
* threads would use the <code>init</code> method to create the
* threads and the <code>destroy</code> method to kill them. <p>
*/

3015 Wp-z 5360 Wp-nno op 2 x SMA-SB3600 TL-21, Warmtepomp: ERSC-VM2CR2 / PUHZ-SHW140 YHA, WTW Q350, EV Kia Ev6 GT-Line


  • zwippie
  • Registratie: Mei 2003
  • Niet online

zwippie

Electrons at work

Je kan van je .jar ook een webstart applicatie maken, dat is (net als een applet) ook click&run vanaf het internet.

How much can you compute with the "ultimate laptop" with 1 kg of mass and 1 liter of volume? Answer: not more than 10^51 operations per second on not more than 10^32 bits.