Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Applets and the fly likes Is Swing without plugin possible or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Is Swing without plugin possible or not?" Watch "Is Swing without plugin possible or not?" New topic

Is Swing without plugin possible or not?


Joined: Jun 29, 2000
Posts: 8
Hi all,
I am attempting to include a table control in my applet, and naturally am having trouble doing it with AWT. I have seen several postings on SUN's message site in which people say they have gotten swing to work by including the swing classes (either all of them or just the ones they need) in the jar file which contains their applet to be downloaded. We want to avoid the browser plugin as this will be for external customer use. Here is what I have tried:
I have unpacked the swingall.jar file into a directory. Placed my applet class (source below) in the root directory. Made a new JAR with the com and javax folders, and my applet class. All I am trying to do is add a JLabel.
import javax.swing.*;
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet {
public void init() {
JLabel j = new JLabel("Hello from swing");
TextField t = new TextField("Hello from AWT");
public void paint(Graphics g) {

What i get when I run this (in Netscape, IE4 and IE5) is the error below. If anyone can help me, I would surely appreciate it.
Thanks in advance,
Bill[javax/swing/plaf/metal/DefaultMetalTheme.<init>]: Unable to access system property: swing.plaf.metal.controlFont
at com/ms/security/permissions/PropertyPermission.check (
at com/ms/security/PolicyEngine.shallowCheck (
at com/ms/security/PolicyEngine.checkCallersPermission (
at com/ms/security/StandardSecurityManager.chk (
at com/ms/security/StandardSecurityManager.checkPropertyAccess (
at java/awt/Font.getFont (
at javax/swing/plaf/metal/DefaultMetalTheme.<init> (
at javax/swing/plaf/metal/MetalLookAndFeel.createDefaultTheme (
at javax/swing/plaf/metal/MetalLookAndFeel.getDefaults (
at javax/swing/UIManager.setLookAndFeel (
at javax/swing/UIManager.setLookAndFeel (
at javax/swing/UIManager.initializeDefaultLAF (
at javax/swing/UIManager.initialize (
at javax/swing/UIManager.maybeInitialize (
at javax/swing/UIManager.getUI (
at javax/swing/text/JTextComponent.updateUI (
at javax/swing/text/JTextComponent.<init> (
at javax/swing/JTextField.<init> (
at javax/swing/JTextField.<init> (
at MyApplet.init (
at com/ms/applet/AppletPanel.securedCall0 (
at com/ms/applet/AppletPanel.securedCall (
at com/ms/applet/AppletPanel.processSentEvent (
at com/ms/applet/AppletPanel.processSentEvent (
at com/ms/applet/ (
at java/lang/ (

Joined: Jul 05, 2000
Posts: 5
browser requires java1.2 plugin for supportin swing components

I agree. Here's the link:
subject: Is Swing without plugin possible or not?
jQuery in Action, 3rd edition