| View previous topic :: View next topic |
| Author |
Message |
Barry Fawthrop Posted via mailing list.
|
Posted: Thu Jun 12, 2008 1:04 pm Post subject: Embedding Applets |
|
|
Greetings All
I'm new to Netbeans (using 6.1) and Java so please excuse the simple
question
I have started creating a JSP
New Project -> Java -> Web Application
I have my .jsp page and I want to embed an applet
I have tried both
<applet>
and currenty
<jsp:plugin jreversion="1.2" type="applet" codebase="applet"
code="localhost.NewClass" width="1024" height="500" ></jsp:plugin>
NewClass.java exists under the
Source Packages
localhost
NewClass.java
and starts as follows
================================================================================================================
package localhost;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.swing.JApplet;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import java.awt.BorderLayout;
/**
*
* @author barry
*/
public class NewClass extends JApplet {
/**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init() {
// TODO start asynchronous download of heavy resources
......
......
================================================================================================================
When I run the jsp I keep getting ClassNotFoundException Erro and then
a blank space on the page with the little red X in the upper left corner
Any ideas on this, Please
Thanks
Barry |
|
| Back to top |
|
 |
Ian Carter Posted via mailing list.
|
Posted: Thu Jun 12, 2008 1:46 pm Post subject: Embedding Applets |
|
|
The package-to-class seperator is "/", not ".".
For the <applet> tag, try:
<applet codebase="applet" code="localhost/NewClass.class"><applet>
I don't know jsp, so can't help you with that one.
Ian
-----Original Message-----
From: Barry Fawthrop [mailto:barry@isscp.com]
Sent: 12 June 2008 14:04
To: nbusers@netbeans.org
Subject: [nbusers] Embedding Applets
Greetings All
I'm new to Netbeans (using 6.1) and Java so please excuse the simple
question
I have started creating a JSP
New Project -> Java -> Web Application
I have my .jsp page and I want to embed an applet I have tried both
<applet>
and currenty
<jsp:plugin jreversion="1.2" type="applet" codebase="applet"
code="localhost.NewClass" width="1024" height="500" ></jsp:plugin>
NewClass.java exists under the
Source Packages
localhost
NewClass.java
and starts as follows
============================================================================
====================================
package localhost;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.swing.JApplet;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import java.awt.BorderLayout;
/**
*
* @author barry
*/
public class NewClass extends JApplet {
/**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init() {
// TODO start asynchronous download of heavy resources ......
......
============================================================================
====================================
When I run the jsp I keep getting ClassNotFoundException Erro and then a
blank space on the page with the little red X in the upper left corner
Any ideas on this, Please
Thanks
Barry |
|
| Back to top |
|
 |
John C. Turnbull Posted via mailing list.
|
Posted: Thu Jun 12, 2008 1:48 pm Post subject: Embedding Applets |
|
|
Hi Barry,
I suggest you create a separate project for the applet and then when you
build that project you will have a JAR in the dist folder (such as
applet.jar). Then you need to get that JAR into your web application. To
do this you need to right click on the web project and select Properties and
then under Build->Packaging there is a button to add a file/folder. Click
on this and then locate your applet.jar file. Also, in your JSP you should
add an "archive" attribute to the "applet" tag which specifies the
applet.jar and you probably don't need the "codebase" attribute. Then build
the WAR.
You should then be able to run the applet from the JSP when you have
deployed the WAR.
As an aside, why are you specifying JRE 1.2?
Hope this helps,
-JCT
| Quote: | -----Original Message-----
From: Barry Fawthrop [mailto:barry@isscp.com]
Sent: Thursday, 12 June 2008 23:04
To: nbusers@netbeans.org
Subject: [nbusers] Embedding Applets
Greetings All
I'm new to Netbeans (using 6.1) and Java so please excuse the simple
question
I have started creating a JSP
New Project -> Java -> Web Application
I have my .jsp page and I want to embed an applet
I have tried both
<applet>
and currenty
<jsp:plugin jreversion="1.2" type="applet" codebase="applet"
code="localhost.NewClass" width="1024" height="500" ></jsp:plugin>
NewClass.java exists under the
Source Packages
localhost
NewClass.java
and starts as follows
=======================================================================
=========================================
package localhost;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.swing.JApplet;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import java.awt.BorderLayout;
/**
*
* @author barry
*/
public class NewClass extends JApplet {
/**
* Initialization method that will be called after the applet is
loaded
* into the browser.
*/
public void init() {
// TODO start asynchronous download of heavy resources
......
......
=======================================================================
=========================================
When I run the jsp I keep getting ClassNotFoundException Erro and
then
a blank space on the page with the little red X in the upper left
corner
Any ideas on this, Please
Thanks
Barry |
|
|
| Back to top |
|
 |
Barry Fawthrop Posted via mailing list.
|
Posted: Thu Jun 12, 2008 2:16 pm Post subject: Embedding Applets |
|
|
Thanks John
I'm trying to create a new Project
Java Class Library in fact
But it will not "fully" create it
It has created the Project Directory
but fails to open and display the project tree
java.lang.NullPointerException
at
org.openoffice.extensions.util.ProjectTypeHelper.getObjectFromUnoProperties(ProjectTypeHelper.java:77)
at
org.openoffice.extensions.util.ProjectTypeHelper.isExtensionProject(ProjectTypeHelper.java:5
at
org.openoffice.extensions.projecttemplates.actions.OOoProjectHook.projectOpened(OOoProjectHook.java:63)
at
org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:81)
at
org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenHookImpl.projectOpened(UILookupMergerSupport.java:198)
at
org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:81)
at
org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:951)
at
org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(OpenProjectList.java:999)
at
org.netbeans.modules.project.ui.OpenProjectList.doOpen(OpenProjectList.java:598)
at
org.netbeans.modules.project.ui.OpenProjectList.access$1100(OpenProjectList.java:123)
at
org.netbeans.modules.project.ui.OpenProjectList$3.run(OpenProjectList.java:494)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Any Ideas ??
Thanks
Barry
John C. Turnbull wrote:
| Quote: | Hi Barry,
I suggest you create a separate project for the applet and then when you
build that project you will have a JAR in the dist folder (such as
applet.jar). Then you need to get that JAR into your web application. To
do this you need to right click on the web project and select Properties and
then under Build->Packaging there is a button to add a file/folder. Click
on this and then locate your applet.jar file. Also, in your JSP you should
add an "archive" attribute to the "applet" tag which specifies the
applet.jar and you probably don't need the "codebase" attribute. Then build
the WAR.
You should then be able to run the applet from the JSP when you have
deployed the WAR.
As an aside, why are you specifying JRE 1.2?
Hope this helps,
-JCT
| Quote: | -----Original Message-----
From: Barry Fawthrop [mailto:barry@isscp.com]
Sent: Thursday, 12 June 2008 23:04
To: nbusers@netbeans.org
Subject: [nbusers] Embedding Applets
Greetings All
I'm new to Netbeans (using 6.1) and Java so please excuse the simple
question
I have started creating a JSP
New Project -> Java -> Web Application
I have my .jsp page and I want to embed an applet
I have tried both
<applet>
and currenty
<jsp:plugin jreversion="1.2" type="applet" codebase="applet"
code="localhost.NewClass" width="1024" height="500" ></jsp:plugin>
NewClass.java exists under the
Source Packages
localhost
NewClass.java
and starts as follows
=======================================================================
=========================================
package localhost;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.swing.JApplet;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import java.awt.BorderLayout;
/**
*
* @author barry
*/
public class NewClass extends JApplet {
/**
* Initialization method that will be called after the applet is
loaded
* into the browser.
*/
public void init() {
// TODO start asynchronous download of heavy resources
......
......
=======================================================================
=========================================
When I run the jsp I keep getting ClassNotFoundException Erro and
then
a blank space on the page with the little red X in the upper left
corner
Any ideas on this, Please
Thanks
Barry |
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|