java - How can I embed a PApplet object into an ordinary applet? -
i have processing sketch written in java (not processing ide) , embed java applet can run web browser's java plugin. processing sketches created extending class called papplet in turn extends component, in principle should quite easy. indeed, this guide explains how embed jframe; this documentation relevant. problem have little experience applets , can't figure out how modify examples have. can help?
andrew right, papplet is a
applet(generalization, extends, etc.) functionalities applet has, processing papplet have plus more. it's matter of exporting applet.
processing 2.0 removed export applet option, it's still present in processing 1.5.1 can stable releases porcessing downloads
another alternative using eclipse proclipsing plugin. plugin allows create processing project (papplet subclass, etc.) , export applet or application. although heavier minimal processing editor, you've got loads of nifty tools in eclipse auto-complete , refactoring name few.
looking @ question again, looks confusion: chicken , egg problem: want use applet because want embed papplet html container. andrew mentioned, can export papplet , embed (the html file generated). using approach: using separate applet contains papplet, you'd this:
import java.applet.applet; import processing.core.papplet; public class capplet extends applet{ public capplet(){ papplet sketch = new yourpappletclassnamehere(); sketch.init(); add(sketch); } }
you need export applet, right ? why , not export papplet in first place ?
Comments
Post a Comment