List component does not get added to Applet, why?

I am trying to display the list component in the applet but it does not get displayed, can anyone help. Here is the code...

import java.awt.GridBagConstraints;

import java.awt.GridBagLayout;

import java.applet.*;

import java.awt.*;

import java.util.ArrayList;

import javax.swing.*;

import javax.swing.JTextField;

publicclass sumdisplayextends Applet

{

Font bigFont;

TextField sumLength;

StringExtract yahooSum =new StringExtract();

TextArea input;

DefaultListModel lItems =new DefaultListModel();

//this method is automatically called when the applet is started

publicvoid init()

{

// required but does not need anything.

setSize(800, 500);

GridBagLayout gbag =new GridBagLayout();

GridBagConstraints gbc =new GridBagConstraints();

setLayout(gbag);

bigFont =new Font("Arial", Font.BOLD, 16);

sumLength =new TextField(10);

//String[] appArray = yahooSum.linkArray.toArray(new String[yahooSum.linkArray.size()]);

//lItems.addElement("ILU");

String [] colors ={"Red","Green","Blue","Yellow","White","Black"};

JList lst =new JList(colors);

lst.setVisibleRowCount(5);

lst.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

lst.setSelectedIndex(0);

JScrollPane scroll_pane =new JScrollPane(lst);

add(scroll_pane);

Label heading =new Label("Dynamic Text Summarizer");

Label sumLenLabel =new Label("Enter Summary Length (percentage)");

Label overSumLabel =new Label("Lexical Overlap Method");

Label randSumLabel =new Label("Random Summary Method");

Label yahooHeadlineLabel =new Label("Yahoo Headlines");

yahooHeadlineLabel.setFont(new Font("Arial", Font.BOLD, 13));

overSumLabel.setFont(new Font("Arial", Font.BOLD, 13));

randSumLabel.setFont(new Font("Arial", Font.BOLD, 13));

gbc.gridwidth = GridBagConstraints.RELATIVE;

gbag.setConstraints(lst, gbc);

heading.setFont(bigFont);

gbc.gridwidth = GridBagConstraints.REMAINDER;

gbag.setConstraints(heading, gbc);

gbc.anchor = GridBagConstraints.WEST;

gbc.gridwidth = GridBagConstraints.REMAINDER;

gbag.setConstraints(sumLenLabel, gbc);

gbc.gridwidth = GridBagConstraints.REMAINDER;

gbag.setConstraints(sumLength, gbc);

gbc.weightx = 1.0;

gbc.gridwidth = 3;

gbag.setConstraints(yahooHeadlineLabel, gbc);

gbag.setConstraints(overSumLabel, gbc);

gbag.setConstraints(randSumLabel, gbc);

//input = new TextArea( "Type text here",8,40); add(input);

add(heading);

add(sumLenLabel);

add(sumLength);

add(yahooHeadlineLabel);

add(overSumLabel);

add(randSumLabel);

//add(scroll_pane);

}

// this method gets called when the applet is terminated (when user goes to another page or leaves the browser

publicvoid stop()

{

//

}

//Method to paint things on the screen

publicvoid paint(Graphics g)

{

}

}

[5077 byte] By [ruuddina] at [2007-10-2 19:03:42]
# 1
if you're going to use Swing components (JList), then use the Swing version of Applet! (JApplet). you're extending the AWT version of Appletand since you're using Swing... don't bother with Label when there's JLabel.. o_O
Woogleya at 2007-7-13 20:42:53 > top of Java-index,Java Essentials,New To Java...
# 2

Hi,

I have implemented the Swing version of applet, but now my browser is not loading the applet, when i right click on the applet area and open the java console, it shows me the following message.

Java Plug-in 1.5.0_06

Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM

User home directory = C:\Documents and Settings\Riaz

-

c:clear console window

f:finalize objects on finalization queue

g:garbage collect

h:display this help message

l:dump classloader list

m:print memory usage

o:trigger logging

p:reload proxy configuration

q:hide console

r:reload policy configuration

s:dump system and deployment properties

t:dump thread list

v:dump thread stack

x:clear classloader cache

0-5: set trace level to <n>

-

createGUI didn't successfully complete

Cookie service is not available - use cache to determine "Cookie"

java.lang.NoClassDefFoundError: ScrollingSimple$1

at ScrollingSimple.init(ScrollingSimple.java:20)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-ScrollingSimple.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: ScrollingSimple$1

at ScrollingSimple.init(ScrollingSimple.java:20)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-ScrollingSimple.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: ScrollingSimple$1

at ScrollingSimple.init(ScrollingSimple.java:20)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-ScrollingSimple.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

AWT blocker activation interrupted:

java.lang.InterruptedException

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Unknown Source)

at sun.awt.AWTAutoShutdown.activateBlockerThread(Unknown Source)

at sun.awt.AWTAutoShutdown.notifyThreadBusy(Unknown Source)

at java.awt.EventQueue.initDispatchThread(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Lake v 1.1 for Java

Copyright (c) David Griffiths, 1996. All rights reserved.

For more information visit http://www.demon.co.uk/davidg,

or contact: dgriffiths@msn.com

java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(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)

Exception in thread "Thread-76" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-null" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

AWT blocker activation interrupted:

java.lang.InterruptedException

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Unknown Source)

at sun.awt.AWTAutoShutdown.activateBlockerThread(Unknown Source)

at sun.awt.AWTAutoShutdown.notifyThreadBusy(Unknown Source)

at java.awt.EventQueue.initDispatchThread(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

AWT blocker activation interrupted:

java.lang.InterruptedException

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Unknown Source)

at sun.awt.AWTAutoShutdown.activateBlockerThread(Unknown Source)

at sun.awt.AWTAutoShutdown.notifyThreadBusy(Unknown Source)

at java.awt.EventQueue.initDispatchThread(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

load: class sumdisplay.class not found.

java.lang.ClassNotFoundException: sumdisplay.class

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.FileNotFoundException: C:\Documents and Settings\Riaz\Desktop\YahooExt\sumdisplay\class.class (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(Unknown Source)

at java.io.FileInputStream.<init>(Unknown Source)

at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)

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

Exception in thread "Thread-146" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.InterruptedException: sleep interrupted

Media Fully Loaded

createGUI didn't successfully complete

Exception in thread "AWT-EventQueue-69" java.lang.NoClassDefFoundError: URLWindow

at ShowDocument.actionPerformed(ShowDocument.java:60)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

java.lang.NoClassDefFoundError: Receiver$1

at Receiver.init(Receiver.java:21)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-Receiver.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: Sender$1

at Sender.init(Sender.java:20)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-Sender.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: GetApplets$1

at GetApplets.init(GetApplets.java:19)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-GetApplets.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: Receiver$1

at Receiver.init(Receiver.java:21)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-Receiver.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: GetApplets$1

at GetApplets.init(GetApplets.java:19)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-GetApplets.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: Sender$1

at Sender.init(Sender.java:20)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-Sender.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: GetOpenProperties$1

at GetOpenProperties.init(GetOpenProperties.java:32)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-GetOpenProperties.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

load: class PrintThread.class not found.

java.lang.ClassNotFoundException: PrintThread.class

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

Exception in thread "Thread-1029" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-PrintThread.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1033" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

load: class sumdisplay.class not found.

java.lang.ClassNotFoundException: sumdisplay.class

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.FileNotFoundException: C:\Documents and Settings\Riaz\RandExample\build\classes\sumdisplay\class.class (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(Unknown Source)

at java.io.FileInputStream.<init>(Unknown Source)

at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)

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

Exception in thread "Thread-1037" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1041" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1050" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1054" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1058" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1062" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1070" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1074" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NoClassDefFoundError: org/htmlparser/util/NodeIterator

at sumdisplay.<init>(sumdisplay.java:14)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(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)

Exception in thread "Thread-1078" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(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.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Exception in thread "thread applet-sumdisplay.class" java.lang.NullPointerException

at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)

at sun.plugin.AppletViewer.showAppletException(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

and my program is:

import java.awt.GridBagConstraints;

import java.awt.GridBagLayout;

import java.applet.*;

import java.awt.*;

import java.util.ArrayList;

import javax.swing.*;

import javax.swing.JTextField;

public class sumdisplay extends JApplet

{

Font bigFont;

JTextField sumLength;

StringExtract yahooSum = new StringExtract();

JTextArea input;

JLabel labelDTS;

DefaultListModel lItems = new DefaultListModel();

//this method is automatically called when the applet is started

public void init()

{

// required but does not need anything.

setSize(800, 500);

labelDTS = new JLabel("Dynamic Text Summarizer");

JPanel labelPanel = new JPanel();

labelPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 20));

labelPanel.add(labelDTS);

getContentPane().add(labelPanel);

}

// this method gets called when the applet is terminated (when user goes to another page or leaves the browser

public void stop()

{

//

}

//Method to paint things on the screen

public void paint(Graphics g)

{

}

}

ruuddina at 2007-7-13 20:42:53 > top of Java-index,Java Essentials,New To Java...
# 3
That's not a Swing issue, your deployment is missing a file.java.lang.NoClassDefFoundError: ScrollingSimple$1
CeciNEstPasUnProgrammeura at 2007-7-13 20:42:53 > top of Java-index,Java Essentials,New To Java...
# 4

I restarted my system and tried to run the applet and it worked fine.

But when I cleaned my project and built it, it does not load again.

The error is

java.lang.NoClassDefFoundError: org/htmlparser/util/NodeIterator

I am using an opensource package "HtmlParser" and the its jar file contains NodeIterator.class, and this class is used by StringExtract.java (this program runs good). As you can see, I try to instantiate StringExtract class in the above code (sumdisplay, an applet). sumdisplay is also in the same project (I am using NetBeans IDE), then why does it show the above error.

And one more thing is, when I run the applet in NetBeans IDE, the appletviewer opens and shows a white blank background screen, and when I maximize the applet window, the background turns gray and it displays the label. And this same applet wont open in the web browser (I tried both Firefox and IE 7).

ruuddina at 2007-7-13 20:42:53 > top of Java-index,Java Essentials,New To Java...
# 5
Is there something that can be done with it...
ruuddina at 2007-7-13 20:42:53 > top of Java-index,Java Essentials,New To Java...