🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10086

Re: can't load MetalLookAndFeel

#10086
From: Jean-Paul Bouzigues
Date: Wed, 17 Nov 1999 00:00
174 lines
6513 bytes
Hi,

For me, load MetalLookAndFeel is OK (please, see below) but i don't know how
to load WindowsLookAndFeel  with JDK 1.2 and JBuilder 2.0.

More informations:
My Applet JDK 1.1 Version (all is OK):
import com.sun.java.swing.*;
import com.sun.java.event.*;
import borland.jbcl.layout.*;
import borland.dbswing.*;
import borland.jbcl.control.*;
import borland.jbcl.control.ImageControl;
import com.sun.java.swing.JOptionPane;

.../...

  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) {}
   }
.../...

New Applet Java 2 SDK 1.2.2 Version:
1)  I add and select the new Java 2 SDK 1.2.2 to the Project Properties.

2) I rename my Swing packages

import javax.swing.*;
import javax.swing.event.*;
import borland.jbcl.layout.*;
import borland.dbswing.*;
import borland.jbcl.control.*;
import borland.jbcl.control.ImageControl;
import javax.swing.JOptionPane;

.../...

  static {
    try {
      // UIManager.setLookAndFeel(new
javax.swing.plaf.metal.MetalLookAndFeel());
      // UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.motif.MotifLookAndFeel());
      com.sun.java.swing.UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
    }
    catch (Exception e) {}
  }
.../...

3) I compile my project: all is OK.

4.1) WindowsLookAndFeel
4.1.1) When I try to execute my Applet with JBuilder 2.0 AppletViewer, i
have got the message

Warning: JIT compiler "javacomp" not found. Will use interpreter.
java.lang.NoClassDefFoundError: com/sun/java/swing/LookAndFeel
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:241)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:508)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:444)
at sun.applet.AppletPanel.run(AppletPanel.java:282)
at java.lang.Thread.run(Thread.java:479)
java.lang.NoClassDefFoundError: com/sun/java/swing/UIManager
at com.capgemini.pau.elastoc.Elastoc.<clinit>(Elastoc.java:204)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:241)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:508)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:444)
at sun.applet.AppletPanel.run(AppletPanel.java:282)
at java.lang.Thread.run(Thread.java:479)

4.1.2) AND When I deploy my applet (with JBuilder 2.0 deployment
tool) and want to execute it in a browser (Netscape 4.5 or IE 4.0, 5.0), i
have got the message:

CacheHandler file name: C:\WINNT\Profiles\jbouzigu\Temporary Internet
Files\KPYZGHUR\Sans_titre1.jar
java.lang.VerifyError: (class: Applet1, method: <clinit> signature: ()V)
Incompatible argument to function
at java.lang.Class.newInstance0(Native Method)
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)

4.2) MetalLookAndFeel
If i try with MetalLookAndFeel
  static {
    try {
      UIManager.setLookAndFeel(new
javax.swing.plaf.metal.MetalLookAndFeel());
      // UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.motif.MotifLookAndFeel());
      // com.sun.java.swing.UIManager.setLookAndFeel(new
com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
    }
    catch (Exception e) {}
  }
4.2.1) with JBuilder 2.0 AppletViewer, i have got the message:

Warning: JIT compiler "javacomp" not found. Will use interpreter.
java.lang.NoClassDefFoundError: borland/jbcl/layout/GridBagConstraints2
at com.capgemini.pau.elastoc.Elastoc.jbInit(Elastoc.java:353)
at com.capgemini.pau.elastoc.Elastoc.init(Elastoc.java:189)
at sun.applet.AppletPanel.run(AppletPanel.java:333)
at java.lang.Thread.run(Thread.java:479)
java.lang.NoClassDefFoundError: borland/jbcl/layout/GridBagConstraints2
at com.capgemini.pau.elastoc.Elastoc.jbInit(Elastoc.java:353)
at com.capgemini.pau.elastoc.Elastoc.init(Elastoc.java:189)
at sun.applet.AppletPanel.run(AppletPanel.java:333)
at java.lang.Thread.run(Thread.java:479)

4.2.2) BUT When I deploy my applet (with JBuilder 2.0 deployment
tool) and want to execute it in a browser (Netscape 4.5 or IE 4.0, 5.0),
that's OK !!!!!!!!!!!!!!!!!


So, what is the solution to use WindowsLookAndFeel with JDK 1.2 ?

Thanks a lot for your help.
Best Regards,
JPaul Bouzigues.

Jean-Paul Bouzigues wrote in message <80r8pr$ifs7@forums.borland.com>...
>Hi,
>
>I agree with you that MetalLookAndFeel is now in javax.swing.plaf.metal.*
>package
>
>BUT IN JDK 1.2.2 (including Swing 1.1.1), there is no change for
>MotifLookAndFeel and WindowsLookAndFeel, which are in
>com.sun.java.plaf.motif.* and com.sun.java.plaf.Windows.*
>
>Can everybody confirm my opinion?
>
>BestRegards.
>JPaul Bouzigues.
>
>Tor Iver Wilhelmsen wrote in message ...
>>V <vladt@rocketmail.com> writes:
>>
>>> this is strange, for i do not really use MetalLookAndFeel (using regular
>>> windows lookandfeel).
>>> getting this for the latest version of netscape as well as for ie.
>>
>>One of two:
>>
>>1) You use the browser JVM:
>>
>>The Deployment Wizard does not pick up the L&F classes, because they
>>are used ydynamically. You basically need to ship all of the Swing
>>version you use, either separately or as a part of the applet JAR.
>>
>>2) You use the plugin:
>>
>>The latest plugins use Swing 1.1.1 or the 1.2 Swing: In both cases,
>>the Metal L&F (default installed) has moved to
>>javax.swing.plaf.metal.*. You need to compile using 1.2.2 libraries.
>
>
>
>
Technical Details
Message-ID: <80u704$a7c9@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38304007.B5C91A2@rocketmail.com> <u66z2ooc7.fsf@sds.no> <80r8pr$ifs7@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,72a63f8268048c5e
X-Google-Attributes: gid111d45,public
From: "Jean-Paul Bouzigues" <jbouzigu@capgemini.fr>
Subject: Re: can't load MetalLookAndFeel
Date: 1999/11/17
Message-ID: <80u704$a7c9@forums.borland.com>
X-Deja-AN: 549675489
References: <38304007.B5C91A2@rocketmail.com> <u66z2ooc7.fsf@sds.no> <80r8pr$ifs7@forums.borland.com>
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700
Newsgroups: borland.public.jbuilder.java.swing