notinited

Status
Nicht offen für weitere Antworten.

Rex

Bekanntes Mitglied
Liebe Freunde,

ich habe versucht, mein Java.Applet in meine HTML-Page einzubinden.
So weit so gut - Java holt sich meine Class...

Und dann kommt plötzlich ein Error:
"Applet xxx notinited".

Das ärgert mich, denn in NetBeans -
wenn ich dort meine Class ausführen lasse,
tritt kein solcher Fehler auf. - Alles läuft, wie es eben laufen soll.


An meiner Konfiguration kann es nicht liegen,
denn ich habe schon viele andere Java-Applets erfolgreich benutzen können.


Bitte deshalb um Hilfe!
Vielen Dank!
MFG
Rex
 

Rex

Bekanntes Mitglied
Hier der Fehler:
BEACHTE: Meine Classes sitzen in diesem Falle direkt in dem Domain-Stammordner (http://www.xxx.de/)!!!
Code:
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
Laden: Klasse [url]http://www.xxx.de/[/url] nicht gefunden
java.lang.ClassNotFoundException: http:..[url]www.xxx.de[/url].
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
 

Rex

Bekanntes Mitglied
Code:
<html>
<head>
<title>TEST!</title>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:207px;
	top:91px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
-->
</style>
</head>
<body>
<script type="text/javascript" src="wz_dragdrop/wz_dragdrop.js"></script>




<div id="Layer1">
  <applet id="IDdesApplets" code="http://www.xxx.de/">
  </applet>
</div>


<script type="text/javascript">
<!--
SET_DHTML(CURSOR_MOVE, SCROLL, "Layer1");//-->
</script>
</body>
</html>

Der Java-Script-Kram ist nur für Drag'n'Drop gedacht und hat keinen Einfluss auf das Applet.
Wenn ich den Java-Script oben weglasse, kommt der gleiche Fehler.


MFG vielen Dank!
Rex
 

KSG9|sebastian

Top Contributor
das sollte wohl so aussehen

Code:
<applet code="MyApplet.class" width="640" height="200" alt="Java-Applets mit HTML-Farbw&hler">
    <param name="TestText" value="SELFHTML">
  </applet>
Die URL hat da nix zu suchen sofern das Applet im gleichen Verzeichnis wie die HTML-Datei liegt.
 

Rex

Bekanntes Mitglied
*stöhn*
Es klappt leider nicht - das Applet liegt übrigens im gleichen Verzeichnis wie die HTML-Page in die es eingebettet werden soll.
Mein aktueller Quelltext:
Code:
<html>
<head>
<title>TEST!</title>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:219px;
	top:351px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer2 {
	position:absolute;
	left:709px;
	top:328px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer3 {
	position:absolute;
	left:18px;
	top:12px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer4 {
	position:absolute;
	left:301px;
	top:46px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer5 {
	position:absolute;
	left:23px;
	top:185px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer6 {
	position:absolute;
	left:457px;
	top:288px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer7 {
	position:absolute;
	left:699px;
	top:33px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer8 {
	position:absolute;
	left:207px;
	top:91px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer9 {
	position:absolute;
	left:227px;
	top:146px;
	width:126px;
	height:49px;
	z-index:9;
}
-->
</style>
</head>
<body>
<script type="text/javascript" src="wz_dragdrop/wz_dragdrop.js"></script>




<div id="Layer1">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer2">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer3">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer4">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer5">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer6">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer7">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer8">
<applet code="" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<script type="text/javascript">
<!--

SET_DHTML(CURSOR_MOVE, SCROLL, "Layer1", "Layer2", "Layer3", "Layer4", "Layer5", "Layer6", "Layer7", "Layer8");

var dy      = 7;
var margTop = 1500;
var posOld;

// Array intended to reflect the order of the draggable items
var aElts = [dd.elements.Layer1, dd.elements.Layer2, dd.elements.Layer3, dd.elements.Layer4, dd.elements.Layer5, dd.elements.Layer6, dd.elements.Layer7, dd.elements.Layer8];

function my_PickFunc()
{
    // Store position of the item about to be dragged
    // so we can interchange positions of items when the drag operation ends
    posOld = dd.obj.y;
}

function my_DropFunc()
{
    // Calculate the snap position which is closest to the drop coordinates
    var y = dd.obj.y+dy/2;
    y = Math.max(margTop, Math.min(y - (y-margTop)%dy, margTop + (aElts.length-1)*dy));
    
    // Index of the new position within the spatial order of all items
    var i = (y-margTop)/dy;
    
    // Interchange the positions of the two items  
    aElts[i].moveTo(100, posOld);
    
    // Let the dropped item snap to position
    dd.obj.moveTo(100, y);
    
    // Update the array according to the changed succession of items
    aElts[(posOld-margTop)/dy] = aElts[i];
    aElts[i] = dd.obj;
}
//-->
</script>
</body>
</html>

ERROR: Applet notinited.
####


Please help!
MFG
vielen Dank!
Rex
 

Leroy42

Top Contributor
Code:
<applet code="" width="160" height="146"...

code="" ? Und woher soll da bitte schön der Browser wissen, wie dein Applet heißt? :shock:
 

Rex

Bekanntes Mitglied
Aber das Applet liegt doch im gleichen Directory wie meine HTML-Page...


MFG
Rex
 

Leroy42

Top Contributor
Rex hat gesagt.:
Aber das Applet liegt doch im gleichen Directory wie meine HTML-Page...

Schön, und hat es auch einen Namen? :autsch:

Code:
<applet code="WieAuchImmerIchHeiße.class" width="123" height="456"/>
 

Rex

Bekanntes Mitglied
Ja, DFApplet.class .
Ich habe den Namen jetzt angegeben.
Aber der Fehler tritt leider immer noch auf :(

Hier besagter Code:
Code:
<html>
<head>
<title>TEST!</title>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:219px;
	top:351px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer2 {
	position:absolute;
	left:709px;
	top:328px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer3 {
	position:absolute;
	left:18px;
	top:12px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer4 {
	position:absolute;
	left:301px;
	top:46px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer5 {
	position:absolute;
	left:23px;
	top:185px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer6 {
	position:absolute;
	left:457px;
	top:288px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer7 {
	position:absolute;
	left:699px;
	top:33px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer8 {
	position:absolute;
	left:207px;
	top:91px;
	width:auto;
	height:auto;
	z-index:1;
	border-color:#333333;
	border-width:thick;
	border-style:ridge;
}
#Layer9 {
	position:absolute;
	left:227px;
	top:146px;
	width:126px;
	height:49px;
	z-index:9;
}
-->
</style>
</head>
<body>
<script type="text/javascript" src="wz_dragdrop/wz_dragdrop.js"></script>




<div id="Layer1">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer2">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer3">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer4">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer5">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer6">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer7">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<div id="Layer8">
<applet code="DFApplet.class" width="160" height="146" alt="Sie m&ssen Java installieren!"><param name="TestText" value="SELFHTML"></applet> 
</div>
<script type="text/javascript">
<!--

SET_DHTML(CURSOR_MOVE, SCROLL, "Layer1", "Layer2", "Layer3", "Layer4", "Layer5", "Layer6", "Layer7", "Layer8");

var posOldx; //Saves the old pos.
var posOldy; //Saves the old pos.

// Array intended to reflect the order of the draggable items
var aElts = [dd.elements.Layer1, dd.elements.Layer2, dd.elements.Layer3, dd.elements.Layer4, dd.elements.Layer5, dd.elements.Layer6, dd.elements.Layer7, dd.elements.Layer8];

function my_PickFunc()
{ //This function is callback, when some Drag'n'Drop object is dragged.
    // Store position of the item about to be dragged
    // so we can interchange positions of items when the drag operation ends
    posOldx = dd.obj.x;
	posOldy = dd.obj.y;
}

function my_DropFunc()
{ //This function is callback, when some Drag'n'Drop object is dropped.
    // Calculate the snap position which is closest to the drop coordinates
	var x = dd.obj.x
	var y = dd.obj.y
    
    // Interchange the positions of the two items  
    
    // Let the dropped item snap to new position
    dd.obj.moveTo(x, y);
}
//-->
</script>
</body>
</html>


Vielen Dank für Deine Bemühungen & Hilfe.

MFG
Rex
 

Rex

Bekanntes Mitglied
Hier der Errorcode:

Fehler hat gesagt.:
Java Plug-in 1.5.0_08
Verwendung der JRE-Version 1.5.0_08 Java HotSpot(TM) Client VM
Home-Verzeichnis des Benutzers = C:\Dokumente und Einstellungen\xxxx


----------------------------------------------------
c: Konsolenfenster schließen
f: Objekte in Finalisierungswarteschlange finalisieren
g: Speicherbereinigung
h: Diese Hilfemeldung anzeigen
l: ClassLoader-Liste ausgeben
m: Speicherbelegung anzeigen
o: Protokollierung auslösen
p: Proxy-Konfiguration neu laden
q: Konsole ausblenden
r: Richtlinien-Konfiguration neu laden
s: System- und Bereitstellungseigenschaften ausgeben
t: Threadliste ausgeben
v: Thread-Stack ausgeben
x: ClassLoader-Cache löschen
0-5: Trace-Stufe auf <n> setzen
----------------------------------------------------

java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: DFApplet
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Zu beachten ist, dass der Error 8x insgesamt auftritt, da ich ja dieses Applet auch 8x eingebunden habe.
Der Fehler tritt aber auch auf, wenn ich nur ein Applet einbinde.

MFG
vielen Dank!
Rex
 

Leroy42

Top Contributor
Da haben wir ja den Übeltäter: java.lang.ClassCastException: DFApplet

DFApplet ist eben keine, von Applet abgeleitete, Klasse.

Mit
Code:
public class DFApplet extends Applet {
muß deine Appletklasse beginnen.
 

Rex

Bekanntes Mitglied
Leider tritt da noch ein Fehler beim compilen auf:
Code:
import java.Applet;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;

public class DFApplet extends Applet {
    public static void main(String[] args)
    {

        JFrame f = new JFrame("Upload-Channel");
        f.setSize(100, 100);
        f.setVisible(true);

        new DropTarget(f, new DropTargetAdapter()
        {
            public void drop(DropTargetDropEvent e)
            {
                try
                {
                    Transferable t = e.getTransferable();
                    DataFlavor d = e.getCurrentDataFlavors()[0];
                    e.acceptDrop(e.getDropAction());
                    List a = (List) t.getTransferData(d);
                    for (int i = 0; i < a.size(); i++)
                    {
                        processFile((File) a.get(i));
                    }
                } catch (Exception ex)
                {
                    ex.printStackTrace();
                }
            }
        });
    }

    public static void processFile(File f)
    {
        try
        {
            System.out.println("Sende Datei "+f);
            // Send data
            URL url = new URL("http://www.xxx/uptest.php");
            URLConnection conn = url.openConnection();
            conn.setDoOutput(true);

            BufferedOutputStream out = new BufferedOutputStream(conn
                    .getOutputStream());
            BufferedInputStream in = new BufferedInputStream(
                    new FileInputStream(f));
           
            int i = in.read();
            while( i!=-1 )
            {
                out.write(i);
                System.out.write(i);
                i=in.read();
            }
            in.close();
            out.flush();
            out.close();
            System.out.println("Datei gesendet");
            
        } catch (Exception e)
        {
            e.printStackTrace();
        }    }
}
C:\Dokumente und Einstellungen\kj09\DF-Applet\src\DFApplet.java:1: cannot find symbol
symbol : class Applet
location: package java
import java.Applet;
C:\Dokumente und Einstellungen\kj09\DF-Applet\src\DFApplet.java:9: cannot find symbol
symbol: class Applet
public class DFApplet extends Applet {
2 errors
BUILD FAILED (total time: 1 second)
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
W Applet notinited nach Java Versionsupdate Allgemeine Java-Themen 12

Ähnliche Java Themen

Neue Themen


Oben