This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java 1.2 applets

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This message is an amplified version of an erlier plea for help.
I am [painfully] aware that current browsers are not Swing enabled, and that the Sun-supplied plugin is supposed to make them play like a Victrola. HOWEVER...Even though the plugin is installed, simple applets (like hello, world) comprising only JApplet children and owning only a JLabel instance will not init.
Here is the code
import java.awt.*;
import javax.swing.*;
import com.symantec.itools.javax.swing.borders.BevelBorder;
/**
* A basic extension of the javax.swing.JApplet class
*/
public class JAppletHello extends JApplet
{
public void init()
{
// Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
symantec.itools.lang.Context.setApplet(this);

// This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// This code is automatically generated by Visual Cafe when you add
// components to the visual environment. It instantiates and initializes
// the components. To modify the code, only use code syntax that matches
// what Visual Cafe can generate, or Visual Cafe may be unable to back
// parse your Java file into its visual environment.
//{{INIT_CONTROLS
getContentPane().setLayout(null);
setSize(426,266);
JLblHello.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
JLblHello.setBorder(bevelBorder1);
JLblHello.setText("HELLO, WORLD!!!");
getContentPane().add(JLblHello);
JLblHello.setBackground(java.awt.Color.red);
JLblHello.setForeground(java.awt.Color.yellow);
JLblHello.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 40));
JLblHello.setBounds(24,42,372,93);
//$$ bevelBorder1.move(0,267);
//}}
}
//{{DECLARE_CONTROLS
javax.swing.JLabel JLblHello = new javax.swing.JLabel();
com.symantec.itools.javax.swing.borders.BevelBorder bevelBorder1 = new com.symantec.itools.javax.swing.borders.BevelBorder();
//}}
}

And here is the HTML code I used:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Mike Roper">
<meta name="GENERATOR" content="Mozilla/4.51 [en] (WinNT; I) [Netscape]">
<title>cryptor</title>
</head>
<body>
<HEAD><TITLE>A SIMPLE HTML PAGE</TITLE></HEAD>
<BODY>
<EMBED type="application/x-java-applet;version=1.2"
java_CODE = "HelloWorld2.class"
java_CODEBASE = "D:\VisualCafe\Projects\cryptor\"
java_ARCHIVE = "HelloWorld2.jar"
WIDTH = 500 HEIGHT = 600
pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html">
</EMBED>
</BODY>
</html>
The archive, codebase, and code are as noted.
The applet loads in Netscape 4.5 but will not init. When I run it under VCafe, it runs just fine. Did I forget to do something?
Help, please.
Mike
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops...I just found out that the project name and class name are different. Sorry to take anyone's time. Please disregard the post.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic