Article View: borland.public.jbuilder.java.swing
Article #12257Re: Problem using Applet with swing classes
From: Tom Davies
Date: Sun, 07 Feb 1999 00:00
Date: Sun, 07 Feb 1999 00:00
118 lines
4091 bytes
4091 bytes
Given that you are getting errors mentioning Netscape, I don't think you've
changed your HTML to invoke the plugin. I think that you are running with
the Navigator VM.
Tom
Manoj wrote in message <36B76A2E.21F08D97@lawson.com>...
>In a effort to reduce applet size I am trying to use swing classes,
>however I am getting errors listed below. What am i missing ..
>
>The applet takes a long time to load because the jar file is 500KB
>The applet uses JBCL Classes ( using Jbuilder 1.0) like tabPanel &
>GridControl
>We are trying to use swing classes.
>So I upgraded my Jbuilder2.01 and applied the beta patch which "allows
>the Designer in JBuilder 2.01 to work with Java Foundation Classes(JFC
>1.1) and to support development work with the version of JFC that comes
>with JDK1.2."
>
>Now I am trying to use JTabbedPane & JTable and using applet that
>extends JApplet.
>I wrote a simple java program using JTabbedPane & JTable.
>
>// Java Program
>package untitled6;
>
>import java.awt.*;
>import java.awt.event.*;
>//import java.applet.*;
>import javax.swing.*;
>
>//import com.sun.java.swing.UIManager;
>public class Applet3 extends JApplet {
> boolean isStandalone = false;
> javax.swing.JTabbedPane jTabbedPane1 = new javax.swing.JTabbedPane();
> javax.swing.JTable jTable = new javax.swing.JTable();
>//Get a parameter value
>
> public String getParameter(String key, String def) {
> return isStandalone ? System.getProperty(key, def) :
> (getParameter(key) != null ? getParameter(key) : def);
> }
>
> //Construct the applet
>
> public Applet3() {
> }
>//Initialize the applet
>
> public void init() {
> try {
> jbInit();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> }
> //static {
> // try {
> // //UIManager.setLookAndFeel(new
>com.sun.java.swing.plaf.metal.MetalLookAndFeel());
> // //UIManager.setLookAndFeel(new
>com.sun.java.swing.plaf.motif.MotifLookAndFeel());
> // UIManager.setLookAndFeel(new
>com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
> // }
> // catch (Exception e) {}
> //}
>//Component initialization
>
> private void jbInit() throws Exception {
> this.setSize(400,300);
> this.getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
> jTabbedPane1.add(jTable, "Tab1");
> }
>//Get Applet information
>
> public String getAppletInfo() {
> return "Applet Information";
> }
>//Get parameter info
>
> public String[][] getParameterInfo() {
> return null;
> }
>}
>
>
>// Java Program ends
>
>Deploying as a jar file , the applet gives the following error when
>deployed :
>( I set the Java Plug-in Property as
> : c:\Program Files\JavaSoft\JRE\1.2
>For Proxy I am using browser setting.
>
>
># Applet exception: error: java.lang.NoClassDefFoundError:
>javax/swing/JApplet
>java.lang.NoClassDefFoundError: javax/swing/JApplet
> at java.lang.ClassLoader.defineClass(Compiled Code)
> at netscape.applet.AppletClassLoader.findClass(Compiled Code)
> at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
>* at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> at
>netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
>Code)
> at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
>Code)
> at java.awt.EventDispatchThread.run(Compiled Code)
> at
>netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
>Code
>
>
>
>
Technical Details
Message-ID:
<79hfcm$pf96@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36B76A2E.21F08D97@lawson.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,e954bb68c2b50687 X-Google-Attributes: gid111d45,public From: "Tom Davies" <tom@netspace.net.au> Subject: Re: Problem using Applet with swing classes Date: 1999/02/07 Message-ID: <79hfcm$pf96@forums.borland.com> X-Deja-AN: 441350159 References: <36B76A2E.21F08D97@lawson.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing