Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Is Swing without plugin possible or not?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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");
add(j);
add(t);
}
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
com.ms.security.SecurityExceptionEx[javax/swing/plaf/metal/DefaultMetalTheme.<init>]: Unable to access system property: swing.plaf.metal.controlFont
at com/ms/security/permissions/PropertyPermission.check (PropertyPermission.java)
at com/ms/security/PolicyEngine.shallowCheck (PolicyEngine.java)
at com/ms/security/PolicyEngine.checkCallersPermission (PolicyEngine.java)
at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)
at com/ms/security/StandardSecurityManager.checkPropertyAccess (StandardSecurityManager.java)
at java/awt/Font.getFont (Font.java)
at javax/swing/plaf/metal/DefaultMetalTheme.<init> (DefaultMetalTheme.java:59)
at javax/swing/plaf/metal/MetalLookAndFeel.createDefaultTheme (MetalLookAndFeel.java:709)
at javax/swing/plaf/metal/MetalLookAndFeel.getDefaults (MetalLookAndFeel.java:714)
at javax/swing/UIManager.setLookAndFeel (UIManager.java:363)
at javax/swing/UIManager.setLookAndFeel (UIManager.java:383)
at javax/swing/UIManager.initializeDefaultLAF (UIManager.java:848)
at javax/swing/UIManager.initialize (UIManager.java:927)
at javax/swing/UIManager.maybeInitialize (UIManager.java:945)
at javax/swing/UIManager.getUI (UIManager.java:560)
at javax/swing/text/JTextComponent.updateUI (JTextComponent.java:396)
at javax/swing/text/JTextComponent.<init> (JTextComponent.java:356)
at javax/swing/JTextField.<init> (JTextField.java:204)
at javax/swing/JTextField.<init> (JTextField.java:185)
at MyApplet.init (MyApplet.java:9)
at com/ms/applet/AppletPanel.securedCall0 (AppletPanel.java)
at com/ms/applet/AppletPanel.securedCall (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
browser requires java1.2 plugin for supportin swing components
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic