public class AppletRes extends JApplet {
private DemoGraphScene scene = new DemoGraphScene();
private javax.swing.JScrollPane jScrollPane1;
/\*\* Initializes the applet AppletRes \*/
@Override
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
jScrollPane1 = new javax.swing.JScrollPane();
jScrollPane1.setViewportView(scene.createView());
add(jScrollPane1, java.awt.BorderLayout.CENTER);
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
....
....
....
<target name="-post-jar">
<jar update="true" destfile="${dist.jar}">
<zipfileset src="${libs.swing-layout.classpath}"/>
<zipfileset src="${file.reference.org-netbeans-api-visual.jar-1}"/>
<zipfileset src="${file.reference.org-openide-util.jar-1}"/>
</jar>
</target>
And that's about it! Corey sent me a link to the result. Below you see his face (yes that's Corey), which can be moved around, it can be zoomed in/out, and the label below the pic can be edited. And everything you see below is in an applet:
It is the first time that I've seen the Visual Library API alive and kicking on the web. In his final note on the above, Corey writes: "Like I said, not much, but it represents a lot of gained knowledge and I am pretty stoked. Now, I am off to add functionality." Here's hoping he'll tell me when he gets to the next stage so I can share it here!
I just wanted to let everyone know that you don't need to zip/jar everything up into one JAR for this to work as an applet. You can reference the JAR files using the archive attribute which may contain a common delimited list of JAR files. That helps surpass any META-INF and manifest issues were entries needed which may otherwise be overwritten.
Ugg...
"common delimited" should be "comma delimited"
This is actually the code that did it.
<target name="-post-jar" depends="Jarsigner">
<jar update="true" destfile="${dist.jar}">
<zipfileset src="${libs.swing-layout.classpath}"/>
<zipfileset src="${file.reference.org-netbeans-api-visual.jar}"/>
<zipfileset src="${file.reference.org-openide-util.jar}"/>
</jar>
<jar update="true" destfile="${dist.dir}/sTestApplet.jar">
<zipfileset src="${libs.swing-layout.classpath}"/>
<zipfileset src="${file.reference.org-netbeans-api-visual.jar}"/>
<zipfileset src="${file.reference.org-openide-util.jar}"/>
</jar>
</target>
I had to add the jars to the signed jar as well. Thanks for posting me. My mom will think I'm famous :)
-Corey
I have no idea what any of this means....but, I think Corey is, indeed, famous. Of course, I am also his Mom.
Wow, great job. Sorry Wade got all bummed out.
Wade, do you need a hug?
This is old but a try is worthy i think\^\^
I have signed (following the tutorial) and added required targets (as Corey depicted) for my VL Applet but it doesn't work. The best case i have until now is just to see the applet's window,nothing more. If you can please send me in my e-mail a piece of code that works (or here).