funtoosh 0 Newbie Poster

I'm implementing a java code for drawing lines using applets in netbeans using javaapplication 11 package.the java code is in src folder and .class and html files are in build folder at their appropriate positions....

It is giving Error:--

java.lang.NoClassDefFoundError: DrawingLines (wrong name: javaapplication11/DrawingLines)

on Java Console.

the code is :---

package javaapplication11;


import java.applet.*;
import java.awt.*;


public class DrawingLines extends Applet {


int width, height;


@Override
public void init() {
width = getSize().width;
height = getSize().height;
setBackground( Color.black );
}


@Override
public void paint( Graphics g ) {
g.setColor( Color.green );
for ( int i = 0; i < 10; ++i ) {
g.drawLine( width, height, i * width / 10, 0 );
}
}
}

and the html code is------

<applet width="300" height="300" code="DrawingLines.class" > </applet>

Can you please figure out the path problem in html file..... or any other one??Although it is working fine when i'm using command line to compile the file without using any package....... but i have to do it in netbeans as some applet elements like Button are not working on command line :(

Please look through it .Thanks in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.