MenuBar in Applet using AWT

I want to create menu in applet that uses only AWT components.
(applet will be run inside HTML page, not in separate window)
Method setMenuBar released only in Frame class. So problem is how to get current frame of applet correctly.
To get current frame I used followed code:
--- CUT ---
Component parent = this; // extended Applet class
while (!(parent instanceof Frame))
     parent = parent.getParent();
((Frame)parent).setMenuBar (...)
--- CUT ---
It works excellent on NN 4.7 under Linux
(menu bar appears at top of applet) but NOT WORK on the
MSIE 5.0 & NN 4.7 under Windows (menu bar not appear)
Can anybody help me ?

Applet is not a subclass of Frame, so your while-loop
will never find a Frame to add the menu bar toBelieve me, it finds one (especially under Linux).
>
Applet does extend panel (which has a default
FlowLayout), so how about setting the panel's layout
to BorderLayout instead, then creating your own
"menubar" panel and adding it at BorderLayout.NORTH?The problem is that you can't add java.awt.MenuBar to Panel because MenuBar class does not extend java.awt.Component.
And method setMenuBar (MenuBar) is implemented only in Frame class, so some instance of Frame class is required anyway.

Similar Messages

  • Saving current Applet using AWT classes only

    Hey Guys,
    Can any one please help me out for saving current applet view using AWT and not SWING plese .
    I tried this code pls check if there is any improvement.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.net.*;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import javax.imageio.ImageIO;
    import java.io.*;
    import com.sun.image.codec.jpeg.*;
    public class temp extends Applet implements ActionListener
    Image myImg;
    Button b1;
         public void init()
              myImg = getImage(getCodeBase(),"temp.jpg");
              b1 = new Button("Save");
              add(b1);
              b1.addActionListener(this);
         public void paint(Graphics g)
              g.drawImage(myImg, 5, 10, this);
              g.fillOval(10,10,20,20);
         public void actionPerformed(ActionEvent ev)
              BufferedImage bin = new BufferedImage( 200, 200,BufferedImage.TYPE_INT_RGB );
              Graphics page = bin.getGraphics();
              page.setColor( java.awt.Color.BLUE );
              page.drawString( "BLUE", 100, 100 );
              ImageIO.write( bin, "JPEG", new java.io.File( "Test7.jpeg" ) );
    PLESE HELP ME SOOOON

    Hi ,Thanx for your concern.
    I am the same sayjava but I lost my password dats why the name is changed.
    Now about the querry i have completely changed the coding and have successfully created a new JPEG image .
    Can u please tell me how can I save it I have tried the following coding but it doent seem to work...
    File file = new File("images", "imgOne.jpg");
    FileOutputStream out = new FileOutputStream(file);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
    param.setQuality(1.0f, false);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(bi); //bi is the BufferedImage
    Thanks Again.

  • Please give me an exemple of an applet using a swing object.

    Please give me an exemple of an applet using a swing object.thank you.

    My problen is that the swing object do not appear in
    my applet. They appear only if i invoque the repaint
    methode.use JApplet, since awt components are heavyweight, and swing components are lightwieght, then your swing components get over painted with aplets background or something.
    anyhow, in your applet you may create JFrame, that would be swing component and if you set it visible, then it will be even visible.
    they say that mixing swing and awt is not good idea, especially when you don't know what you're doing (which might be true in your case)
    so try to migrate your app from AWT based stuff to SWING based stuff, or write your own AWT components that do the job whih you needed swing component for at the first place.
    but if you need to mix awt and swing, then i thing that you should not paint the fole area of applet in applets paint method -- but here i'm not sure, never mixed 'em.
    so you might try to create an applet which paint() method you leave empty and to which you add some JComponent*.
    and see what happens, maybe this JComponent will be visible.
    * -- JComponent is most likely just gray, you might want to add some subclass of it -- JButton, JTextField, JSomethingElse.

  • Chat Applet using RMI .... trouble running the Applet using the IE browser.

    Hi,
    I'm trying to run a chat application using RMI technology. Actually, this wasn't created from the scratch. I got this one from from the cd that comes with the book I bought and I did some refinements on it to suit what I wanted to:
    These are the components of the chat application:
    1. RApplet.html - invokes the applet
    html>
    <head>
    <title>Sample Applet Using Dialog Box (1.0.2) - example 1</title>
    </head>
    <body>
    <h1>The Sample Applet</h1>
    <applet code="RApplet.class" width=460 height=160>
    </applet>
    </body>
    </html>
    2. RApplet.java - Chat session client applet.
    import java.rmi.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.rmi.server.*;
    //import ajp.rmi.*;
    public class RApplet extends Applet implements ActionListener {
    // The buttons
    Button sendButton;
    Button quitButton;
    Button startButton;
    Button clearButton;
    // The Text fields
    TextField nameField;
    TextArea typeArea;
    // The dialog for entering your name
    Dialog nameDialog;
    // The name the server knows us as
    String privateName;
    // The name we want to be known as in the chat session
    String publicName;
    // The remote chats erver
    ChatServer chatServer;
    // The ChatCallback
    ChatCallbackImplementation cCallback;
    // The main Chat window and its panels
    Frame mainFrame;
    Panel center;
    Panel south;
    public void init() {
    // Create class that implements ChatCallback.
    cCallback = new ChatCallbackImplementation();
         // Create the main Chat frame.
         mainFrame = new Frame("Chat Server on : " +
                        getCodeBase().getHost());
         mainFrame.setSize(new Dimension(600, 600));
         cCallback.displayArea = new TextArea();
         cCallback.displayArea.setEditable(false);
         typeArea = new TextArea();
         sendButton = new Button("Send");
         quitButton = new Button("Quit");
         clearButton = new Button("Clear");
         // Add the applet as a listener to the button events.
         clearButton.addActionListener(this);
         sendButton.addActionListener(this);
         quitButton.addActionListener(this);
         center = new Panel();
         center.setLayout(new GridLayout(2, 1));
         center.add(cCallback.displayArea);
         center.add(typeArea);
         south = new Panel();
         south.setLayout(new GridLayout(1, 3));
         south.add(sendButton);
         south.add(quitButton);
         south.add(clearButton);
         mainFrame.add("Center", center);
         mainFrame.add("South", south);
         center.setEnabled(false);
         south.setEnabled(false);
         mainFrame.show();
         // Create the login dialog.
         nameDialog = new Dialog(mainFrame, "Enter Name to Logon: ");
         startButton = new Button("Logon");
         startButton.addActionListener(this);
         nameField = new TextField();
         nameDialog.add("Center", nameField);
         nameDialog.add("South", startButton);
         try {
         // Export ourselves as a ChatCallback to the server.
         UnicastRemoteObject.exportObject(cCallback);
         // Get the remote handle to the server.
         chatServer = (ChatServer)Naming.lookup("//" + "WW7203052W2K" +
                                  "/ChatServer");
         catch(Exception e) {
         e.printStackTrace();
         nameDialog.setSize(new Dimension(200, 200));
         nameDialog.show();
    * Handle the button events.
    public void actionPerformed(ActionEvent e) {
         if (e.getSource().equals(startButton)) {
         try {
              nameDialog.setVisible(false);;
              publicName = nameField.getText();
              privateName = chatServer.register(cCallback, publicName);
              center.setEnabled(true);
              south.setEnabled(true);
              cCallback.displayArea.setText("Connected to chat server as: " +
                             publicName);
              chatServer.sendMessage(privateName, publicName +
                             " just connected to server");
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(quitButton)) {
         try {
              cCallback.displayArea.setText("");
              typeArea.setText("");
              center.setEnabled(false);
              south.setEnabled(false);
              chatServer.unregister(privateName);
              nameDialog.show();
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(sendButton)) {
         try{
              chatServer.sendMessage(privateName, typeArea.getText());
              typeArea.setText("");
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(clearButton)) {
         cCallback.displayArea.setText("");
    public void destroy() {
         try {
         super.destroy();
         mainFrame.setVisible(false);;
         mainFrame.dispose();
         chatServer.unregister(privateName);
         catch(Exception e) {
         e.printStackTrace();
    3. Chatcallback.java - interface used by clients to connect to the server.
    import java.rmi.*;
    public interface ChatCallback extends Remote {
    public void addMessage(String publicName,
                   String message) throws RemoteException;
    4. ChatcallbackImplementation.java - implements Chatcallback interface.
    import java.rmi.*;
    import java.io.*;
    import java.awt.event.*;
    import java.awt.*;
    public class ChatCallbackImplementation implements ChatCallback {
    // The buttons
    // The Text fields
    TextArea displayArea;
    public void addMessage(String publicName,
                   String message) throws RemoteException {
    displayArea.append("\n" + "[" + publicName + "]: " + message);
    5. Chatserver.java - interface for the chat server.
    import java.rmi.*;
    import java.io.*;
    public interface ChatServer extends Remote {
    public String register(ChatCallback object,
                   String publicName) throws RemoteException;
    * Remove the client associated with the specified registration string.
    * @param registeredString the string returned to the client upon registration.
    public void unregister(String registeredString) throws RemoteException;
    * The client is sending new data to the server.
    * @param assignedName the string returned to the client upon registration.
    * @param data the chat data.
    public void sendMessage(String registeredString, String message) throws RemoteException;
    6. ChatServerImplementation.java - implements Chatserver interface.
    import java.rmi.*;
    import java.util.*;
    import java.rmi.server.*;
    import java.io.*;
    * A class that bundles the ChatCallback reference with a public name used
    * by the client.
    class ChatClient {
    private ChatCallback callback;
    private String publicName;
    ChatClient(ChatCallback cbk, String name) {
         callback = cbk;
         publicName = name;
    // returns the name.
    String getName() {
         return publicName;
    // returns a reference to the callback object.
    ChatCallback getCallback() {
         return callback;
    public class ChatServerImplementation extends UnicastRemoteObject
    implements ChatServer {
    // The table of clients connected to the server.
    Hashtable clients;
    // Tne number of current connections to the server.
    private int currentConnections;
    // The maximum number of connections to the server.
    private int maxConnections;
    // The output stream to write messages to.
    PrintWriter writer;
    * Create a ChatServer.
    * @param maxConnections the total number if connections allowed.
    public ChatServerImplementation(int maxConnections) throws RemoteException {
         clients = new Hashtable(maxConnections);
         this.maxConnections = maxConnections;
    * Increment the counter keeping track of the number of connections.
    synchronized boolean incrementConnections() {
         boolean ret = false;
         if (currentConnections < maxConnections) {
         currentConnections++;
         ret = true;
         return ret;
    * Decrement the counter keeping track of the number of connections.
    synchronized void decrementConnections() {
         if (currentConnections > 0) {
         currentConnections--;
    * Register with the ChatServer, with a String that publicly identifies
    * the chat client. A String that acts as a "magic cookie" is returned
    * and is sent by the client on future remote method calls as a way of
    * authenticating the client request.
    * @param object The ChatCallback object to be used for updates.
    * @param publicName The String the object would like to be known as.
    * @return The actual String assigned to the object for removing, etc. or
    * null if the client could not register.
    public synchronized String register(ChatCallback object, String publicString) throws RemoteException {
         String assignedName = null;
         if (incrementConnections()) {
         ChatClient client = new ChatClient(object, publicString);
         assignedName = "" + client.hashCode();
         clients.put(assignedName, client);
         out("Added callback for: " + client.getName());
         return assignedName;
    * Remove the client associated with the specified registration string.
    * @param registeredString the string returned to the client upon registration.
    public synchronized void unregister(String registeredString) throws RemoteException {
         ChatCallback cbk;
         ChatClient sender;
         if (clients.containsKey(registeredString)) {
         ChatClient c = (ChatClient)clients.remove(registeredString);
         decrementConnections();
         out("Removed callback for: " + c.getName());
         for (Enumeration e = clients.elements(); e.hasMoreElements(); ) {
              cbk = ((ChatClient)e.nextElement()).getCallback();
              cbk.addMessage("ChatServer",
                        c.getName() + " has left the building...");
         else {
         out("Illegal attempt at removing callback (" + registeredString + ")");
    * Sets the logging stream.
    * @param out the stream to log messages to.
    protected void setLogStream(Writer out) throws RemoteException {
         writer = new PrintWriter(out);
    * The client is sending new message to the server.
    * @param assignedName the string returned to the client upon registration.
    * @param data the chat data.
    public synchronized void sendMessage(String registeredString, String message) throws RemoteException {
         ChatCallback cbk;
         ChatClient sender;
         try {
         out("Recieved from " + registeredString);
         out("Message: " + message);
         if (clients.containsKey(registeredString)) {
              sender = (ChatClient)clients.get(registeredString);
              for (Enumeration e = clients.elements(); e.hasMoreElements(); ) {
                   cbk = ((ChatClient)e.nextElement()).getCallback();
                   cbk.addMessage(sender.getName(), message);
         else {
              out("Client " + registeredString+ " not registered");
         catch(Exception ex){
         out("Exception thrown in newData: " + ex);
         ex.printStackTrace(writer);
         writer.flush();
    * Write s string to the current logging stream.
    * @param message the string to log.
    protected void out(String message){
         if(writer != null){
         writer.println(message);
         writer.flush();
    * Start up the Chat server.
    public static void main(String args[]) throws Exception {
         try {
         // Create the security manager
         System.setSecurityManager(new RMISecurityManager());
         // Instantiate a server
         ChatServerImplementation c = new ChatServerImplementation(10);
         // Set the output stream of the server to System.out
         c.setLogStream(new OutputStreamWriter(System.out));
         // Bind the server's name in the registry
         Naming.rebind("//" + args[0] + "/ChatServer", c);
         c.out("Bound in registry.");
         catch (Exception e) {
         System.out.println("ChatServerImplementation error:" +
                        e.getMessage());
         e.printStackTrace();
    Using my own machine (connected to a network), I tried to test this one out by setting mine as the server and also the client. I did the following:
    1. Compile the source code.
    2. Use rmic to generate the skeletons and/or stubs from the ChatCallbackImplementation and ChatServerImplementation.
    3. Start the rmiregistry with no CLASSPATH
    4. Start the server successfully.
    5. Start the applet using the AppletViewer command.
    It worked fined.
    The problem is when I ran the applet using the browser, IE explorer, the dialog boxes, frame and buttons did appear. I was able to do the part of logging on. But after that, the applet seemed to have hang. No message appeared that says I'm connected (which appeared using the appletviewer). I clicked the send button. No response.
    I double-checked my classpath. I did have my classpath set correctly. I'm still trying to figure out the problem. Up to now, I don't have any clue what it is.
    I will appreciate much if someone can help me figure what's could have possibly been wrong ....
    Thanks a lot ...

    Hi Domingo,
    I had a similar problem running applet/rmi with IE.
    Looking in IE..view..JavaConsole error messages my applet was unable to find java.rmi.* classes.
    I checked over java classes in msJVM, they're not present.
    ( WinZip C:\WINDOWS\JAVA\Packages\9rl3f9ft.zip and others from msVM installed )
    ( do not contain the java.rmi.* packages )
    I have downloaded and installed the latest msJVM for IE5. ( I think its included in later versions)
    @http://www.objectweb.org/rmijdbc/RJfaq.html I found ref to rmi.zip download to provide
    these classes. I couldn't get the classes from the site but I managed to find a ref to IBM
    site @http://alphaworks.ibm.com/aw.nsf/download/rmi which had similar download.
    The download however didn't solve my problems. I was unable to install rmi.zip with
    RmiPatch.exe install.
    I solved this by extracting the class files from rmi.zip and installing them at C:\WINDOWS\JAVA\trustlib ( msJVM installation trusted classes lib defined in
    registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\TrustedLibsDirectory )
    This solved the problem. My rmi/applet worked.
    Hope this helps you.
    Chris
    ([email protected])

  • Use awt to display histogram in a JSP?!

    Hi,
    I have been searching the web in the area awt and JSP and it feels like I am fumbling in the dark. I want to display a histogram, which shall be updated continuously from a database. I have found a program example, which is creating a histogram using awt. This example is using a frame and my question is, could I import this frame to my JSP or is there a way to make use of the awt class in a JSP and display, draw the histogram directly in my JSP page?
    Thanks in advance!

    The only way to use AWT in a JSP would be to put the
    AWT in a applet and put the applet in the JSP.

  • Can I use AWT elements in a JSP, and so could I generate events with them?

    This is because I�m doing a simple JSP that showing a button, my JSP is:
    <html>
    <%@ page import="java.awt.*" %>
    <%! Button b = new Button("Hola!!!"); %>
    <% add(b); %>
    </html>
    But when I tried to see the button in the browser, my JSP generates the following:
    Compilation of '/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java' failed:
    /RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java:79: cannot resolve symbol
    probably occurred due to an error in /gep/alterno/23_mayo/mr4.jsp line 7:
    <% add(b); %>
    Could somebody help me please?.....
    Can I use AWT elements in a JSP, and so could I generate events with them?
    Thanks!!!

    There are 2 ways to run a web page dynamically:
    1) Reload the page via use of javascript or some other scripting language.
    2) Use an applet to regularly check a URL for the data
    Remember, as Paul pointed out, JSP's only generate HTML output. AWT components need to run inside a JVM not a just the browser.
    I could recommend an applet but you may have problems with IE6 not supporting java. Otherwise there shouldn't be too much of a prob.
    If you prefer to use an AWT/Swing setup (for example an application) rather than a JSP setup, Webstart is good for delivering online applications which operate standalone or remotely.
    When you consider that the Java-Plugin and the Webstart puligin are about the same size it's just a matter of weighing up who your target clients are and whats easiest.
    Cheers,
    Anthony

  • Problem in loading an applet using JRE 1.5

    Hi,
    I have an applet which is working fine under JRE 1.4, but the same applet failing to load by using JRE 1.5
    Problem Description:
    1. The images in the applet fails to load using JRE 1.5
    2. The Username and Password text box are also failing to initialize.
    Can anyone help me out in this.
    Is there any code changes required ?

    I wonder if you have the same problem as me... Maybe we can find a solution for us both, no need for me to open a new thread for this topic then...
    I wrote an applet using Swing and compiled it using JavaSDK 1.4.x. I also installed the 1.4.x JRE for both of my test browsers. In Mozilla 1.1 the applet displays properly all the time. In IE6 SP1 it sometimes works as intended but sometimes the applet simply stops working, as per my Java Console somewhere after invoking the "start" method. Parts of the applet simply become gray and when I resize it - I have a JFrame in my applet - the whole JFrame becomes gray and does not respond to input nor it redraws itself. Shutting down IE does not close the JFrame(although the java console reports normal program termination and cleanup) and the only way to close it is through the task manager. I am using Windows 98SE btw.
    Does it sound similiar to your problem? It happens ONLY with IE, not with Mozilla. Anybody has an idea on what it could be? I doubt there's an error in my code...

  • Html file to run an Applet using swings in 1.4.1 or 1.3.1

    Can anyone send me an html document to launch the applet in a browser. I have very basic html, but I need one that uses the appropriate plug-in and that has parameters such as height, width, etc. My applet uses tabbed panes, dialog boxes and comboboxes. It works well with appletviewer, but does not work in IE or Netscape.
    Thank you for your help
    here is what I am using which does does show anything but a grey screen
    <HTML>
    <HEAD>
    <TITLE>
    CIS 602 Semister Project
    </TITLE>
    </HEAD>
    <BODY>
    <BR>
    <H3>
    <CENTER>
    Swing
    </CENTER>
    </H3>
    <H3>
    <BR><BR>
    <P><H3>
    <CENTER>
    <BR><BR>
    <P><h2>
    Structured Problem Solving Strategy
    </h2>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "570" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.4.2" java_CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" ></XMP>
    <PARAM NAME = CODE VALUE = "semiclient.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4.2">
    </APPLET>
    </NOEMBED></EMBED></OBJECT>
    <!--
    <APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" >
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </Center>
    <BLOCKQUOTE><PRE>
    </PRE></BLOCKQUOTE>
    </H3>
    <BLOCKQUOTE><PRE>
    </PRE></BLOCKQUOTE>
    </H3>
    </BODY></HTML>

    Try this:
    <HTML>
    <HEAD>
    <TITLE>CIS 602 Semister Project</TITLE>
    </HEAD>
    <BODY>
    <CENTER><H3>Swing</H3></CENTER><CENTER><H2>Structured Problem Solving Strategy</H2></CENTER>
            <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                width="750"
                height="575"
                align="baseline"
                codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab">
                <PARAM NAME="code"       VALUE="full.qualified.ClassName">
                <PARAM NAME="codebase"   VALUE="path/to/your/class/files/or/archive/">
                <PARAM NAME="archive"    VALUE="nameOfJarWhichContainsClassFiles.jar">
                <PARAM NAME="type"       VALUE="application/x-java-applet;version=1.4">
                <PARAM NAME="scriptable" VALUE="false">
                <COMMENT>
                    <EMBED type="application/x-java-applet;version=1.4"
                        width="750"
                        height="575"
                        align="baseline"
                        code="full.qualified.ClassName"
                        codebase="path/to/your/class/files/or/archive/"
                        archive="nameOfJarWhichContainsClassFiles.jar"
                        pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
                        <NOEMBED>
                            No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
                        </noembed>
                    </embed>
                </COMMENT>
            </OBJECT>
    </BODY>
    </HTML>

  • Japanese text display problems in applet using plugin

    Hi,
    We've been beating our heads against the wall on this one for quite some time, so any help would be greatly appreciated.
    Our product uses a third party applet (Kavachart from Visual Engineering) to display graphical statistics from our database. We are currently localizing our product to support english and japanese. With Japanese enabled, all pages use euc-jp encoding. The problem we are running into is in the display of japanese text inside this applet in IE 5 and NS 4.7x when using the java plugin (1.3 or 1.4). If the default jre of the browsers are used, the text in the applet renders fine.
    On a suggestion from the supprot folks at Visual Engineering, I modified our code to set the defaultFont parameter on the applet to "serif, 14, 1". With this set, the text in the applet renders ok in IE, but NS on windows and unix is still broken. Given that we are doing all these tests on machines running a native japanese OS, it's not even clear to me why setting the defaultFont should even be required, but at this point, I'll take anything :-)
    Has anyone else run into this and either solved it or proven that a solution is not feasible? I'm at my wits end here....
    Thanks in advance,
    Mark Evangelisto
    Synchronicity Inc.

    If you are using different java plugin, you need to install the international version of the JRE; otherwise, some characters may not be able to display correctly since some of the properties files are missing.
    As for Visual Engineering's suggestion. I don't know why they tell you to set the default font on the applet because it may cause the browser to use the font specified. Your applet works on IE because it will try to use the best font to match the web page's content. For NS anything less then 6.0 (technology based on Mozilla), they never display web page correctly especially if you did what VE suggest.
    If you are running the applet on the native langauge OS with the international version of the JRE installed, the applet should display correctly without setting the default font. If it is not the native langauge OS, first you need to install the international version of the JRE and have the fonts that are able to display the language the applet use.

  • Writing new HTML to a page from an applet using LiveConnect, 1.3.1 Plug-i

    Has anyone been able to successfully replace a page with an applet with the dynamically generated HTML from an applet using LiveConnect and Plugin 1.3.1 in Netscape 6.2 or IE?
    The following works fine without plugin or with 1.4.0 beta3 plugin.
    Here is the code that I use without plugin:
    JSObject windowObject = JSObject.getWindow(this);
    JSObject documentObject = (JSObject) windowObject.getMember("document");
    documentObject.call("close",null);
    documentObject.call("open",null);
    String anArray1[] = {null};
    anArray1[0] ="some HTML here";
    documentObject.call("write", anArray1);
    documentObject.call("close",null);
    Here is the code that I use with 1.4.0 plugin:
    JSObject windowObject = JSObject.getWindow(this);
    JSObject documentObject = (JSObject) windowObject.getMember("document");
    String anArray1[] = {null};
    anArray1[0] ="some HTML here";
    documentObject.call("write", anArray1);
    When I try to use anyone of the above using plugin 1.3.1, the browser either hangs or plugin generates runtime error. What is the correct way of writing to a document object? Or what is the way that works for 1.3.1 plugin?

    Hi,
    I am doing this in my applet to replace the page containing the applet with the new content. I tested that extensively with Netscape 4.7 and IE 5.5+. Definitely works if you are using Java Plug-In 1.3.1_02. Does not work well in Netscape 6.2.
        protected void setPageContent(final String newContent) {
            final JSObject window = JSObject.getWindow(this);
            final JSObject document = (JSObject) window.getMember("document");
            new Thread( new Runnable() {
                            public void run() {
                                document.call("clear", null);
                                document.call("write", new String[]{newContent});
                                try {
                                              document.call("close", null);
                                   } catch (JSException ignored) {
                        } ).start();

  • Can you please tell me how can i change the parameter of Applet using Aspec

    Respect Members
    Can we apply Aspectwerkz on Applet? In our project we have to
    change the method parameters before its execution(Around Advice) , can we do this in applet using Aspectwerkz?
    Can you please tell me how can i change the parameter of Applet using Aspectwerkz or AspectJ ?
    I did it by for Java Application using the AspectJ And Aspectwerkz But not able to do for Applet.
    For Applet I Am setting the parameter in JAVA plug in for Aspectwerkz e.g. -Xdebug -Xrunaspectwerkz -Xbootclasspath & path for xml file in which pointcut is defined.
    If you any Friend working on it or any author who might be helpfull for me please Forward this mail to him/her
    THANKs in Advance
    [email protected]

    hello rodale, what you're seeing is probably a side effect of firefox not being able to save certain preferences into its profile folder.
    go to ''firefox > help > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js'''.
    in case this didn't solve the issue yet please also refer to [[How to fix preferences that won't save]].

  • Memory leak with 1.6.0_07 in applet using Swing

    Java Plug-in 1.6.0_07
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    Windows XP - SP2
    I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
    The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.

    I am Using Internet Explorer Browser Version 6.0.Huge security hole.
    Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
    Catch 'Throwable'. And log/display it somewhere.

  • Displaying java applet using webseal authentication

    Hi all,
    i'm facing a problem about displaying Java applet using Webseal junction for accessing  an application Server based on Websphere.
    I've defined a webseal ACL on accessing a http url that contains link to Java applet: after webseal authentication, the homepage is loaded; in the home page are presented links to java applet, but when I try to load these applets, it seems not working.
    If I load the same applets without Webseal authentication, it seems working.
    Is there any sort of configuration to make for applet regarding Webseal?
    Thanks in advance
    Danilo

    Hi all,
    i'm facing a problem about displaying Java applet using Webseal junction for accessing  an application Server based on Websphere.
    I've defined a webseal ACL on accessing a http url that contains link to Java applet: after webseal authentication, the homepage is loaded; in the home page are presented links to java applet, but when I try to load these applets, it seems not working.
    If I load the same applets without Webseal authentication, it seems working.
    Is there any sort of configuration to make for applet regarding Webseal?
    Thanks in advance
    Danilo

  • Problem with access JSF applet using javascript

    Can someone help me!
    I'm using a applet in jsf page, and i'm trying to access this applet using a javascript.
    Here is the applet code
    <jsp:plugin code="DoAction.class" codebase="." height="400" hspace="10" jreversion="1.5" type="applet" vspace="50" width="100" name="myApp"/>
    Here is the javascript
    function printReturn()
    var a = document.myApp.returnString();
    alert(a);
    "returnString" is the method in applet which simply return a string
    But it doesn't work, it works well when i'm using this applet in JSF
    <applet code="DoAction.class" width="100" height="50" name="myApp" ></applet>
    Unfortunately it's depricated!
    Please tell me what is the solution....

    Thank You for replying.
    I'm trying to call applet method using JavaScript.
    It works when i'm using below apllet tag.
    <applet code="DoAction.class" width="100" height="50" name="myApp" ></applet>
    But it's deprecated
    It doesn't work for below applet tag
    <jsp:plugin code="DoAction.class" codebase="." height="400" hspace="10" jreversion="1.5" type="applet" vspace="50" width="100" name="myApp"/>
    This is my javascript
    <script type="text/javascript">
    function setSearch()
    var a = document.myApp.returnString();
    alert(a);
    </script>

  • Java Applets with AWT

    Hi,
    I have the problem to display the applet with AWT. If I am running the same applet in the internal server it works fine.If I am running through the web its giving Class not found exception.That web server also is mapped into the same server.
    Here is the code.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class NotHelloWorldApplet extends Applet
    public void init()
         try{
              setLayout(null);
              Label label1= new Label("Hello World!");
              label1.setSize(200,200);
              add(label1);
         }catch(Exception e){System.out.println(e);}
    <html><body>
    <applet
    code="NotHelloWorldApplet"
    codebase="."
    width=600 height=400
    >
    </applet>
    </body></html>
    can anyone help me please.
    Thanks

    Hello,
    Even I executed the program. Its works fine. I guess you must be having problem with the codebase. Just change the address in the codebase from current directory to the address where the class file is there and also change the permissions(set attributes to 755) of the class file. Hope this helps you.
    Regards,
    Sarada.

Maybe you are looking for

  • How do I get my iCal to update from my Mac to my iPhone via iCloud?

    I am running OSX 10.7.2 on my Mac, and iOS5 on my iPhone 4 and iPad 2. I have enabled iCloud on all three devices. My music is syncing, but my iCal and Contacts do not appear to be. I have been adding events and contacts to my Mac and they are not ap

  • PO Document type change & verson problem in one po

    Hai Friends, U used change po document type after creation of po. now For one po i couldn't able to change. what could be the reason ? for that po verson also not coming please tell me

  • 24in, 2.8ghz imac overheating?

    Hi, Since installing Snow Leopard, I've started noticing that my imac is running noticeably hotter. Using iStatpro I recorded 63 degrees C on the HD the other day, and the fan noise was pretty noticeable (normally they're very quiet). Tonight, for ex

  • HP pro 8500A all in 1

    Since trying to use Smart Print all I get is a column of print. I can not get it to change back to full page. Off line printing is ok but anything over the internet comes out in one column.

  • Adobe acrobat X error:  no more memory on web capture pages

    I try to create a pdf file by saving a web site and i have a memory error (out af memory) after capturing pages. I see that acrobat processus take the memory continuously during the capture process without leaving memory free. When i store the pdf an