Swing Applet - doesnt work

Hi,
I'm trying to get a swing applet to work on windows 9x/2000 platform with Internet Explorer 5.
I need the applet to show some text boxes and buttons. all simple stuff.
I'm using j2sdk1.4.1 to compile the applet. And i've read on the net that i need java plugin 1.2 to run the swing applet.
The articles say to use this HTML code which is supposed to download the new plug-in if IE can't run it but it never does. any ideas?
<HTML>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="120" height="160" align="middle"
codebase="http://java.sun.com/products/plugin/1.2/
jinstall-12-win32.cab#Version=1,2,0,0">
<PARAM NAME="code" VALUE="AppletGreeting1.class">
</OBJECT>
<HTML>
I've also read that i can have swing.jar in my classes path and that will fix my problems but all i have is swingapplet.jar and that doesn't work. I've excluded the archive parameter from the object tags because i'm running the html file in the same folder.
Does anyone have any ideas please because this isn't as straight forward as i would have liked it to be.??
cheers

The plugin you are attempting to download from Sun ("http://java.sun.com/products/plugin/1.2/
jinstall-12-win32.cab#Version=1,2,0,0")
is an old version. I have had problems downloading this before, so I modified my html to serve the plugin from a local system. That may be your problem. If you have installed j2sdk1.4.1, I think you have the plugin. You may want to check. Verify plugin is enabled
On IE its under
Tools-Internet Options-Advanced (Use Java 2 v1.4....
On Netscape, plugins are listed under
Help-About Plugins
You can download the plugin directly from Sun @
http://java.sun.com/getjava
Pete

Similar Messages

  • My swing applets dont work in IE!!! Anyone can help?

    Hi to everyone, I`ve read a lot about this subject this last week,
    but I don`t seem able to solve my problems, that are kind of a mistery,
    and any help will be wonderful.
    I`ve developped some swing applets with KAWAPro v 4.01. I had no problems running them on the appletviewer, but when I tried to do it on the IE6 I found that it didn`t work at all. The message from the window
    help dialog was "class Myclass not found", and when I opened the Java console I found the message that follows:
    java.lang.ClassNotFoundException: javax.swing.JApplet
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at java/lang/ClassLoader.resolveClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    And this happens with any applet I want to run locally, even with those I`ve downloaded from the sun site. But I can see perfectly any swing applet remotly when I access to the sun www pages.
    I tried including ARCHIVE = "rt.jar" in the HTML code, with rt.jar the jar file that includes the javax.swing.JApplet class. Then things changed, and the message I get from the Java console is:
    warning: running 1.2 version of SwingUtilities
    java.lang.InstantiationException: MyClass
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    That doesn`t seem to mean anything to me. I`ve tried something with CAB files, but anything works. I also have the Java Plug in installed.
    I`ve tried to run my applets locally in other computers and I found not problem, so I`m kind of puzzled, and I`ve no idea what`s happening.
    I`d be thankful if anyone could help me.
    Regards: Tony

    it sounds like you don't have the swing classes on the classpath - I don't really understand how this would happen (unless you have a pre-131 environment)
    Try downloading the JRE again?

  • Loading the same native Libaries in different Applets doesnt work !

    The problem is the following :
    I have applet_1 that does System.loadLibary("mydll")
    and i have applet_2 that does System.loadLibary("mydll")
    both calls are static but it doesnt matter.
    When i call applet_1 first in my browser it can do anything it wants (function calling in dll etc).
    When i call applet_2 after that in my browser, it doesnt load the libary, nothing happends - no exception thrown it just doesnt happend anything. The applet works fine but cant do any method calling to the dll.
    The same happends if i open applet_2 first and after that applet_1 suffer the same problems that it cant call any dll methods, unless i close the browser.
    So, the first applet that loads the libary is the only one who is able to call methods within the dll.
    Further observation is, i made a simple class that only loads the libary, i set an int to 1 when the libary is loaded, however when the other applet calls that class the int is NOT 1 anymore, it has its initally value which leads me to believe that every applet in the java plugin has its own virtual machine.
    I found this thread, it has the very same problem. However i didnt find anything about the bug 4299094.
    http://forum.java.sun.com/thread.jsp?forum=30&thread=33843
    Any ideas what i could do to solve this problem ? When i copy the dll and rename it to mydll2 i can use mydll in applet_1 and mydll2 in applet_2.
    Regards

    Further notice :
    I put both applet classes into one jar after i read about the Class Loader Issues in the documentation of the java plugin.
    "Class Loader Issues
    Prior to version 1.3.1_01a, Java Plug-in would use a single class loader to load multiple applets during a browser session. This practice allowed the multiple applets to share information with each other through static variables.
    In order to maximize compatibility with the Java virtual machines embedded in Microsoft Internet Explorer browsers, beginning with version 1.3.1_01a Java Plug-in uses separate class loaders for applets that differ in their codebase and/or the value of the ARCHIVE parameter in the APPLET tags that invoke the applets. Only if two or more applets share the same codebase and have the same value for their ARCHIVE parameter will the same class loader be used.
    Applets that rely explicitly on the old Java Plug-in behavior with respect to class loaders may be incompatible with the new Java Plug-in. That is, applets that rely on the ability to share information afforded by a single class loader may fail to work properly if the new Java Plug-in uses separate class loaders for each applet. If this compatibility issue applies to your applets, you can force Java Plug-in to use a single class loader for multiple applets by simply ensuring that all applets have the same codebase and that the APPLET tags used to launch the applets each has the same value for the ARCHIVE parameter. "
    Both applets now can load the libary but ONLY if executed in the SAME window, if i open a new window and load applet_1 or applet_2 the libary cant be loaded in the NEW window. It will still work flawless in the old window for applet_1 and applet_2 but in the new window applet_1 and applet_2 dont work.

  • Swing applet

    I've been trying to get my browser (Netscape 4.77
    on Windows NT) to run swing applets. I've got
    jre 1.3.1 installed and it said it got the plugin,
    but when i try to run the test applet at the url
    www.java.com/products/jfc/tsc/articles/getting_started/applet_test.html i get an error message complaining
    about class format errors and bad magic numbers.
    i've also tried to do the same on my linux system
    and had no success (although a different error)
    how do i get swing applets to work?

    It's frustrating...isn't it?
    I ran into the same problem and found out that the demo on their site was out of date. After I downloaded the tutorial from Sun, everything worked out ok. Try the link below for a download:
    http://java.sun.com/docs/books/tutorial/
    V.V.

  • Oracle JDBC and Swing Applets

    Hi
    I'm trying yo connect to an oracle databse using the oracle thin driver
    in a Swing Applet deriving from JApplet class using a JTable .
    Note my browser is Swing enabled and i can view normal swing applets.
    But i get an error which says
    Oracle/jdbc/driver/oracel/driver not found
    But if i run this as an application instead of a swing applet it works
    Remember it's a Swing Applet not a normal Applet.and the oracle driver works in a normal application.this error occurs only when the oracle driver is used in a Swing Applet.
    any ideas?
    mail me at [email protected]
    '**********************Heres the code************************
    import java.sql.*;
    import java.lang.*;
    import java.awt.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    <applet code =testdata.class width=300 height=300></applet>
    class databaseconnect{
    public Connection conn;
    public ResultSet rs;
    databaseconnect(){}
         public void connect(){
              try{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());     
              conn = DriverManager.getConnection("jdbc:oracle:thin:@theserver:1521:dbase", "un", "pw");
              }catch(SQLException e) { }
         public ResultSet getdata(){
              try{
              Statement st = conn.createStatement();
              rs = st.executeQuery("select * from tt");
              }catch (SQLException e) { }
         return rs;
    class toggledata{
    static ResultSet rs;
    static String s,r;
    //public static void main(String args[]){
    databaseconnect data = new databaseconnect();
    public String makestr(){
         s = "1";
         r = "1";
         try{
         data.connect();
         rs = data.getdata();
              while(rs.next()){
                   s = s + "," + rs.getString(1);
                   r = r + " " + rs.getString(2);
         }catch (SQLException e) {}
         //System.out.println(s);
         //System.out.println(r);
    return s;
    public class testdata extends JApplet{
    int d,cont,y;
    String t;
    char n,m;
    int c;
    Object h;
    //public testdata(){
    public void init(){
         //super("My First Oracle Application");
         cont = 0;
         y=1;
         h = ",";
         //colstr e = new colstr();
         toggledata f = new toggledata();
         String rs = new String(f.makestr());
         Object [][] data = new Object [1][15];
         char chars [] = rs.toCharArray();
         for(int x=0; x<15; x++){
              data [0][cont] = new Integer(chars[x]);
              cont = cont + 1;
         String [] col ={"a","b","c","d","e","f","g","h","i","f","g","h","i","j","k"};
         final JTable table = new JTable(data, col);
         table.setPreferredScrollableViewportSize(new Dimension(500, 70));
         JScrollPane scrollPane = new JScrollPane(table);
         getContentPane().add(scrollPane, BorderLayout.CENTER);
    //public static void main(String args []){
    //     testdata g = new testdata();
    //     g.pack();
    //     g.setVisible(true);
    Thanks

    continued...
    I re-read your problem , your problem is as same as me.
    So, unzip classes12.zip oy folder /htdocs/ on your server
    , when this file is unziped it will create the necessary
    folders and files so your program will find the drivers
    classes and I think your problem is solved.
    Thanks Jamanir

  • Button doesnt work

    Hi
    Below is the coding that i have created i am trying to make the button play a sound when it is pressed. It worked for one button but when i put the second button it doesnt work, any help will be greatly appreciated. Thanks
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import java.io.PrintStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.applet.AudioClip;
    import java.net.URL;
    public class Panel1 extends JPanel implements ActionListener
    private JButton logout, open;
    //AudioClip onceClip, loopClip;
    //URL codeBase;
    public Panel1()
    //String [] fileTypes = {wavFile};
    //public MalformedURLException();
    //private URL("C:/JBuilder3/myprojects/untitled1/)
    //throws MalformedURLException
    logout = new JButton(" Logout ");
    logout.addActionListener(this);
    logout.setActionCommand("logout");
    open = new JButton("Hello");
    open.addActionListener(this);
    open.setActionCommand("Hello");
    JPanel controlPanel = new JPanel();
    controlPanel.add(logout);
    controlPanel.add(open);
    add(controlPanel);
    public void actionPerformed( ActionEvent evt )
    // play a sound before loging out
    try
    if (logout == logout);
    java.applet.AudioClip clip =
    java.applet.Applet.newAudioClip(new java.net.URL("C:/JBuilder3/myprojects/untitled1/logout.wav"));
    clip.play();
    catch (MalformedURLException ex)
    try
    (open = open);
    java.applet.AudioClip clip =
    java.applet.Applet.newAudioClip(new java.net.URL("C:/JBuilder3/myprojects/untitled1/i.wav"));
    clip.play();
    catch (MalformedURLException pex)
    public static void main(String s[]) {
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    JFrame f = new JFrame("Panel");
    f.addWindowListener(l);
    f.getContentPane().add(new Panel1());
    //f.setSize(new Dimension(400,100));
    f.show();
    }

    Please use code tags, as described in formatting tips.
    What does "does not work" mean? Throws an execption, nothing happens when you click the button, comple error?

  • Applet Not Working in Browser

    I built a java applet that works fine in the applet viewer, but just appears as a gray screen in a web browser. In the status bar of the web browser, it says that the applet has been started. The only possible cause of this that I can think of is a failure to connect to the internet. The program should appear like that if it fails to connect to the internet when it first starts. If this is the problem, please see my other post about making that work.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=449444&tstart=0&trange=15

    1) What Browser?
    2) What is you code?
    1) If it is Internet Explorer, the problem would be an outdated JVM. MS JVM only supports up to Java 1.1.8 so you would have to rework your Applet to fit with just those classes/methods present at that time (ie no Swing, and check the APIs to make sure that the since version isn't past 1.1.
    If you are using other browsers, the old JVM may be a problem as well. It should be easy enough to install the latest one.
    2) Start out with something simple, like a hello world. Get that to work, then worry about the more complicated stuff.

  • Unable to download images in a swing applet (1.3.1) behind proxy

    Hi
    One of my client have a proxy server and firewall and when they try to access my webserver
    then all the AWT applet are downloaded and rendered on client properly. However, the swing applet written
    using JDK 1.3.1 is downloaded and rendered but it doesn't display anything properly as images
    are not down loaded. I have used media tracker to add images to it like oMediaTracker.addImage( oImage, index );
    and then oMediaTracker.waitForAll();
    Java console display at client looks as follows:
    Java(TM) Plug-in: Version 1.3.1
    Using JRE version 1.3.1 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\toy
    Proxy Configuration: no proxy
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Applet Initialization start...
    Applet Image Initialization start...
    Trace level set to 5: basic, net, security, ext, liveconnect ... completed.
    Opening      http:MyServer/24/x.gif
    Connecting     http:MyServer/24/x.gif with no proxy
    Connecting
    http:MyServer/24/x.gif with cookie "ASPSESSIONIDGQGQQVWC=DLNBDAOABFANEPJFFIGOOIPG;
    JSESSIONID=25Ais2tF1eBkevUhAa2akocfShzNdzyL7yC1I7UhJl7Z6BLZrnQK!
    -1149265879"
    Opening      http:MyServer/40/y.gif
    Connecting      http:MyServer/40/y.gif with no proxy
    Connecting      http:MyServer/40/y.gif with cookie "ASPSESSIONIDGQGQQVWC=DLNBDAOABFANEPJFFIGOOIPG;
    JSESSIONID=25Ais2tF1eBkevUhAa2akocfShzNdzyL7yC1I7UhJl7Z6BLZrnQK!
    -1149265879"
    Opening     http://MyServer/sun/beans/infos/PanelBeanInfo.class
    Connecting     http://MyServer/sun/beans/infos/PanelBeanInfo.class with no proxy
    Connecting http://MyServer/sun/beans/infos/PanelBeanInfo.class with cookie "ASPSESSIONIDGQGQQVWC=DLNBDAOABFANEPJFFIGOOIPG;
    JSESSIONID=25Ais2tF1eBkevUhAa2akocfShzNdzyL7yC1I7UhJl7Z6BLZrnQK!
    -1149265879"
    Opening http://MyServer/java/awt/ContainerBeanInfo.class
    Connecting http://MyServer/java/awt/ContainerBeanInfo.class with no proxy
    Connecting http://MyServer/java/awt/ContainerBeanInfo.class
    Client machine tries to access these images but i never receive a call at web server end when i see
    IIS log.
    CLient environment:
    -Windows 2000/XP/NT
    -Internet explorer 6.0 SP1 or IE 5.5 SP2
    with connection->LAN Setting->Use Automatic configuration script(only checked)
    -Java Plugin configured like proxies->Use Browser Setting
    -JDK 1.3.1 plug in at client(downloaded and Installed automatically on demand)
    -Object tag used to download applet and plugin
    -Firewall and proxy(i don't know about vendor)
    My webserver environment
    Windows 2000/iis 5.0 with anonymous authentication and
    cache-control header set to no-store (so that proxy doesn't cache anything)
    QUESTIONS:
    ~~~~~~~~~
    Q.1. When i try from home network that has a proxy then everything works fine. At client site everything except
    image download works fine. I mean jars are downloaded and i can see anything drawn using JAVA API.
    When i try from home i see following java console trace
    Java(TM) Plug-in: Version 1.3.1
    Using JRE version 1.3.1 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\wuko
    Proxy Configuration: Automatic Proxy Configuration
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Trace level set to 5: basic, net, security, ext, liveconnect ... completed.
    Applet Initialization start...
    Applet Image Initialization start...
    Opening http://MyServer/24/connec.gif
    Connecting http://MyServer/24/connec.gif with proxy=197.168.1.100:808
    Connecting http://MyServer/24/connec.gif with cookie "ASPSESSIONIDQQGQQCYU=GBJFAOABCJFPDMGFHEKLDACA; JSESSIONID=26yu5m1b4upVuXoAoDmtMbWXQmetQpyzqjFANszo9vFubujT4qGX!-1149265879"
    Opening http://MyServer/24/cool.gif
    Connecting http://MyServer/24/cool.gif with proxy=197.168.1.100:808
    Connecting http://MyServer/24/cool.gif with cookie "ASPSESSIONIDQQGQQCYU=GBJFAOABCJFPDMGFHEKLDACA; JSESSIONID=26yu5m1b4upVuXoAoDmtMbWXQmetQpyzqjFANszo9vFubujT4qGX!-1149265879"
    etc
    I can't set the plugin at client to use automatic script just like IE browser uses. This option is not supported in JRE1.3.1. Looks to be supported in JRE1.4.1. My client doesn't want to set manual proxy ip and port in plugin as they don't want to reveal this info to everyone within the company for security reason.
    Q.2. Why some classes like PanelBeanInfo.class, JAppletBeanInfo.class are downloaded
    from my server while it doesn't exist at my webserver. Any thing stupid IE or plugin doing
    at client. Any Idea?
    Thanks in advance for any help.
    Ratan

    Thanks to Mike and other friends who already replied on this topic.
    Here is my research analysis:
    Answer to Question 1:
    ~~~~~~~~~~~~~~~~~~~~~
    The solution is to bundle all the images with JAR. Bundle with jar whichever needs it. However, it might require duplicacy.
    Image img = null;
    try
    img = Toolkit.getDefaultToolkit().getImage(getClass().getResource(fileName));
    catch (Exception e) { }
    In this case make sure that you have image at the same location where you access it. For example if you have to access an image in package class com.awt.ui.MyClass then your image should also be at location ..\com\awt\ui
    Note: It will require image duplicacy in your JAR but it solves the problem. It gives the advantage of fewer download from server.
    Answer to Question 2:
    ~~~~~~~~~~~~~~~~~~~~~
    IE treats applet as an active-X and try to look for these classes in your JAR. SUN has stopped its support in JDK1.3.1 and plus. What one can do is to create dummy classes with these names and bundle it with your JAR. You have to create these dummy classes if you enable Basic authentication on your web server then browser will try to look for these classes on the server and continue to prompt you for login and password. It might bother your customer un-necessarily to enter login and password too many times prompted by plug-in (plug in).
    --Ratan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Best IDE and how-to create HTML for a swing Applet

    Can you help me out? I've been using, and teaching with the old Symantec VisualCafe product from long, long, ago. It still works fine & I can even use it to build JFC/Swing Applets etc. But a few things have occurred. For one, a way back, Symantec sold VisualCafe to WEBGAIN - who now has gone out of business and sold it to a company called TOGETHERSOFT - who doesn't support it any longer.
    This isn't really a big deal to me, because I can still build and deploy applets that are pre-swing easily enough. (as can my students)
    HOWEVER... I'd like to be running with the LATEST Java (I think it's 1.4.01) and I'd LIKE to use whatever is the best development environment I can use - especially one I can recommend to my students. Do you know what that should be?
    What's more, I'd still like to take some JFC/Swing created applets (even if compiled with the older VisualCafe IDE) and generate the HTML to allow 1.4 enabled browsers to run them (this is the case for the schools versions of Explorer and Netscape). Now, the HTML I have INSTALLED for the students used the HTML converter - back in 1.2 to produce the HTML at the bottom of this. This code no longer works now with current browsers. Do you know HOW one makes a jfc/swing compiled applet run on the latest browsers?
    Any help or direction you can give would be appreciated.
    thanks,
    Bobby Berns
    [email protected]
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 756 HEIGHT = 396 codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
    <PARAM NAME = CODE VALUE = "lottery.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.2" java_CODE = "lottery.class" WIDTH = 756 HEIGHT = 396 pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"><NOEMBED></COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    <!--
    <APPLET CODE = "lottery.class" WIDTH = 756 HEIGHT = 396 >
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->

    Bobby,
    It's been a while since I've used the HTML Converter, but if I had to guess I'd say you need a newer version than what you have. Also, doesn't the converter allow you to choose which JDK you want to use (in which case you could select 1.4)? Again it's been a while so bear with me. Another option would be to put all the Swing classes into a .jar file (typically called swingall.jar) on your server and include that file as an attribute in your applet tag like this:
    <APPLET CODE="yourApplet.class" ARCHIVE="swingall.jar">
    This way you don't have to use the Java Plug-in, however the initial download time of the .jar file can be significant.
    As for an IDE, I've always been happy using a text editor like UltraEdit. However, I've heard good things about Forte, and hey, it's free!
    Regarding Christina's post, that solution will only work if the Applet does not use Swing components (and Bobby specifically said it does). By using the <OBJECT> and <EMBED> tags, rather than the <APPLET> tag, you force the browser to use the Java Plug-in (rather than the browser's default JVM).
    Hope that helps,
    - Sheepy

  • Java Swing Applets in Mac Os

    hi there,
    I am a student at the University of Portsmouth in the UK in my third and last year. I am doing my dissertation as a game using applets for a client at the university of which there consits four prototypes. One of the main specification points is that it should work on an apple mac, therefore I am using Swing applets. however with my first prototype it works fine on windows in windows Explorer, firefox and Netscape but i cant get it to work on Mac os 9 or X even with the latest version of java installed on the machine. Can anyone tell me why this is so, I would be very gratefull.
    As I cant post the whole applet here as a file download I will just put some code snippets of the main program classes.
    Applet ------------------------------
    * Class JugglingBalls - A sub class of JApplet that combines the GameInterface and GamePanel into a single application
    * @author (Liam Morren)
    * @version (v1.0)
    import java.awt.*;
    import javax.swing.*;
    public class JugglingBalls extends JApplet
        // instance variables -----------------------------------------------------------------------------------------------------------------------------------
        private GamePanel gamePanel; // The game panel including game and render loop
        private GameInterface gameInterface; // The swing interface to modify the game scene components
        // JApplet methods -------------------------------------------------------------------------------------------------------------------------------------
         * Called by the browser or applet viewer to inform this JApplet that it
         * has been loaded into the system. It is always called before the first
         * time that the start method is called.
        public void init()
            gamePanel = new GamePanel();
            gameInterface = new GameInterface(gamePanel.getGameScene());
            Container content = getContentPane(); // The container for components in the applet
            setLayout(new BoxLayout(content, BoxLayout.X_AXIS));
            content.add(gamePanel);
            content.add(gameInterface);
         * Returns information about this applet.
         * An applet should override this method to return a String containing
         * information about the author, version, and copyright of the JApplet.
         * @return a String representation of information about this JApplet
        public String getAppletInfo()
            // provide information about the applet
            return "Title: JugglingBalls  \nAuthor: Liam Morren  \nA simple application showing balls juggling in the air.";
    Interface -------------------------------------
    * Class GameInterface - Lets you manipulate the game components using swing components
    * @author (Liam Morren)
    * @version (v1.0)
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class GameInterface extends JPanel
        // instance variables -------------------------------------------------------------------------------------------------------------------------------------
        private GameScene gameScene; // Reference to the game scene
        private JTabbedPane gameTabs; // Tabs for Game, Balls and Background
        // Scene panel
        JButton pause, start, reset; // Buttons
        // Balls panel
        JRadioButton redBall, greenBall, blueBall, archBall, figureOfEightBall; // Radio buttons
        JCheckBox canSplit; // Check box
        JComboBox setAllPaths, setAllTypes, newBall, selectBall; // Drop down boxes
        JButton deleteBall; // Button
        Ball currentBall; // Current ball being changed
        // Background panel
        JRadioButton black, white, red, green, blue, hide, show, stop, move, arch, figureOfEight; // Radio buttons
        // Constructors -------------------------------------------------------------------------------------------------------------------------------------------
         * Constructor for objects of class GameInterface
        public GameInterface(GameScene gameSceneIn)
            gameScene = gameSceneIn; // Reference to the game scene
            gameTabs = new JTabbedPane(); // JTabbedPane to hold different toolbars
            gameTabs.setPreferredSize(new Dimension(200, 494)); // Set the preffered size for the tabbed pane
            currentBall = gameScene.getBall(0); // First ball
            // Add the panels to the tabbed pane
            gameTabs.addTab("Scene", makeScenePanel());
            gameTabs.addTab("Balls", makeBallsPanel());
            gameTabs.addTab("Background", makeBackgroundPanel());
            add(gameTabs); // Add the tab to the game interface panel
            setPreferredSize(new Dimension(200, 200));
        // Other methods ------------------------------------------------------------------------------------------------------------------------------------------
         * makeScenePanel
         * @return JPanel - The scene panel with buttons added
        private JPanel makeScenePanel()
            // Make scene panel
            JPanel scenePanel = new JPanel();
            scenePanel.setLayout(new BoxLayout(scenePanel, BoxLayout.Y_AXIS)); // Change layout
            pause = new JButton("Pause"); // Make buttons
            start = new JButton("Start");
            reset = new JButton("Reset");
            // Add button actions
            pause.addActionListener(new ActionListener() // Add button listener to pause button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    gameScene.setPaused(true); // Pause game
            start.addActionListener(new ActionListener() // Add button listener to start button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    gameScene.setPaused(false); // Unpause game
            reset.addActionListener(new ActionListener() // Add button listener to reset button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    gameScene.reset(); // Reset game
                    updateSelectBallComboBox();
                    changeSelectedBall(0);
            scenePanel.add(pause); // Add buttons to scene panel
            scenePanel.add(start);
            scenePanel.add(reset);
            return scenePanel;
         * makeBackgroundPanel
         * @return JPanel - The background panel with buttons added
        private JPanel makeBackgroundPanel()
            // Make scene panel
            JPanel backgroundPanel = new JPanel();
            backgroundPanel.setLayout(new GridLayout(5, 1, 2, 2)); // Change layout
            // Make buttons
            // background colour buttons
            JPanel backgroundcolour = new JPanel(); // Change backgroundcolour panel
            backgroundcolour.setBorder(BorderFactory.createLineBorder(Color.black));
            black = new JRadioButton("Black"); // Radio buttons to change colour
            white = new JRadioButton("white");
            black.setSelected(true); // Set black as already selected
            ButtonGroup backColourGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
            backColourGroup.add(black); // Add buttons to group
            backColourGroup.add(white);
            backgroundcolour.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
            backgroundcolour.add(new JLabel("Background colour")); // Add label
            backgroundcolour.add(black); // Add buttons to colours panel
            backgroundcolour.add(white);
            // Add radio button actions
            black.addActionListener(new ActionListener() // Add button listener to black button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    gameScene.setBackgroundColour(false); // Background colour = black
            white.addActionListener(new ActionListener() // Add button listener to white button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    gameScene.setBackgroundColour(true); // Background colour = white
            // colour buttons
            JPanel colours = new JPanel(); // Change colours panel
            colours.setBorder(BorderFactory.createLineBorder(Color.black));
            red = new JRadioButton("Red"); // Radio buttons to change colour
            green = new JRadioButton("Green");
            green.setSelected(true); // Set green as already selected
            blue = new JRadioButton("Blue");
            ButtonGroup colourGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
            colourGroup.add(red); // Add buttons to group
            colourGroup.add(green);
            colourGroup.add(blue);
            colours.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
            colours.add(new JLabel("Change colours")); // Add label
            colours.add(red); // Add buttons to colours panel
            colours.add(green);
            colours.add(blue);
            // Add radio button actions
            red.addActionListener(new ActionListener() // Add button listener to red button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (gameScene.getBackgroundEffect().getColour() != 0)
                        gameScene.getBackgroundEffect().setColour(0); // Background effect colour = red
            green.addActionListener(new ActionListener() // Add button listener to green button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (gameScene.getBackgroundEffect().getColour() != 1)
                        gameScene.getBackgroundEffect().setColour(1); // Background effect colour = green
            blue.addActionListener(new ActionListener() // Add button listener to blue button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (gameScene.getBackgroundEffect().getColour() != 2)
                        gameScene.getBackgroundEffect().setColour(2); // Background effect colour = blue
            // hide buttons
            JPanel hideShow = new JPanel(); // Change hideShow panel
            hideShow.setBorder(BorderFactory.createLineBorder(Color.black));
            hide = new JRadioButton("Hide"); // Radio buttons to hide show
            show = new JRadioButton("Show");
            show.setSelected(true); // Set show as already selected
            ButtonGroup hideShowGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
            hideShowGroup.add(hide); // Add buttons to group
            hideShowGroup.add(show);
            hideShow.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
            hideShow.add(new JLabel("Hide / Show")); // Add label
            hideShow.add(hide); // Add buttons to hideShow panel
            hideShow.add(show);
            // Add radio button actions
            hide.addActionListener(new ActionListener() // Add button listener to hide button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().hide(); // Hide
            show.addActionListener(new ActionListener() // Add button listener to show button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().unHide(); // Unhide
            // stopMove buttons
            JPanel stopMove = new JPanel(); // Change StopMove panel
            stopMove.setBorder(BorderFactory.createLineBorder(Color.black));
            stop = new JRadioButton("Stop"); // Radio buttons to stop move
            move = new JRadioButton("Move");
            stop.setSelected(true); // Set stop as already selected
            ButtonGroup stopMoveGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
            stopMoveGroup.add(stop); // Add buttons to group
            stopMoveGroup.add(move);
            stopMove.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
            stopMove.add(new JLabel("Stop / Move")); // Add label
            stopMove.add(stop); // Add buttons to stopMove panel
            stopMove.add(move);
            // Add radio button actions
            stop.addActionListener(new ActionListener() // Add button listener to stop button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().setMove(false); // stop
            move.addActionListener(new ActionListener() // Add button listener to move button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().setMove(true); // move
            // changePath buttons
            JPanel changePath = new JPanel(); // Change changePath panel
            changePath.setBorder(BorderFactory.createLineBorder(Color.black));
            arch = new JRadioButton("Arch"); // Radio buttons to change path
            figureOfEight = new JRadioButton("Figure of eight");
            arch.setSelected(true); // Set stop as already selected
            ButtonGroup changePathGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
            changePathGroup.add(arch); // Add buttons to group
            changePathGroup.add(figureOfEight);
            changePath.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
            changePath.add(new JLabel("Change Path")); // Add label
            changePath.add(arch); // Add buttons to changePath panel
            changePath.add(figureOfEight);
            // Add radio button actions
            arch.addActionListener(new ActionListener() // Add button listener to arch button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().setPath(new Arch()); // Arch
            figureOfEight.addActionListener(new ActionListener() // Add button listener to figureOfEight button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        gameScene.getBackgroundEffect().setPath(new FigureOfEight()); // Figure of eight
            // Add components to background panel
            backgroundPanel.add(backgroundcolour);
            backgroundPanel.add(colours);
            backgroundPanel.add(hideShow);
            backgroundPanel.add(stopMove);
            backgroundPanel.add(changePath);
            return backgroundPanel;
         * makeBallsPanel
         * @return JPanel - The ball panel with buttons added
        private JPanel makeBallsPanel()
            // Make balls panel
            JPanel ballsPanel = new JPanel();
            ballsPanel.setLayout(new BoxLayout(ballsPanel, BoxLayout.Y_AXIS)); // Change layout
            // Make buttons
            // set all drop down boxes
            JPanel setAll = new JPanel(); // Set all panel
            setAll.setBorder(BorderFactory.createLineBorder(Color.black));
            String[] setAllPathsChoices = {"Arch", "Figure of eight"}; // Selections for set all paths
            setAllPaths = new JComboBox(setAllPathsChoices); // Add selections to combo box
            String[] setAllTypesChoices = {"Primary ball", "Pastel ball", "3D ball", "Image ball"}; // Selections for set all types
            setAllTypes = new JComboBox(setAllTypesChoices); // Add selections to combo box
            setAll.add(new JLabel("Set all paths")); // Add combo boxes to set all panel
            setAll.add(setAllPaths);
            setAll.add(new JLabel("Set all types"));
            setAll.add(setAllTypes);
            // Add combo box actions
            setAllPaths.addActionListener(new ActionListener() // Add selection listener to set all paths combo box
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (setAllPaths.getSelectedItem() == "Arch")
                        gameScene.setAllPathsArch();
                    else
                        gameScene.setAllPathsFigureOfEight();
            setAllTypes.addActionListener(new ActionListener() // Add selection listener to set all types combo box
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (setAllTypes.getSelectedItem() == "Primary ball")
                        gameScene.setAllTypesPrimaryBall();
                    else if (setAllTypes.getSelectedItem() == "Pastel ball")
                        gameScene.setAllTypesPastelBall();
                    else if (setAllTypes.getSelectedItem() == "Image ball")
                        gameScene.setAllTypesImageBall();
                    else
                        gameScene.setAllTypesBall3D();
            // new ball drop down box
            JPanel newBallPanel = new JPanel(); // new ball panel
            newBallPanel.setBorder(BorderFactory.createLineBorder(Color.black));
            String[] newType = {"Primary ball", "Pastel ball", "3D ball", "Image ball"}; // Selections for new ball
            newBall = new JComboBox(newType); // Add selections to combo box
            newBallPanel.add(new JLabel("New ball")); // Add combo boxes to new ball panel
            newBallPanel.add(newBall);
            // Add combo box actions
            newBall.addActionListener(new ActionListener() // Add selection listener to newBall combo box
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    String ballType = (String) newBall.getSelectedItem();
                    if (ballType == "Primary ball")
                        gameScene.addBall(new PrimaryBall(gameScene));
                    else if (ballType == "Pastel ball")
                        gameScene.addBall(new PastelBall(gameScene));
                    else if (ballType == "Image ball")
                        gameScene.addBall(new ImageBall(gameScene));
                    else
                        gameScene.addBall(new Ball3D(gameScene));
                    updateSelectBallComboBox();
                    changeSelectedBall(gameScene.getBalls().size() - 1); // Update interface to show new ball
            // selected ball panel
            JPanel selectedBallPanel = new JPanel(); // selected ball panel
            selectedBallPanel.setBorder(BorderFactory.createLineBorder(Color.black));
            // Select ball
            selectBall = new JComboBox(gameScene.getBallList()); // Add ball list to the select drop down box
            deleteBall = new JButton("DeleteBall"); // Delete button
            // Ball colour
            redBall = new JRadioButton("Red"); // Red choice
            redBall.setSelected(true); // Start as selected
            greenBall = new JRadioButton("Green"); // Green choice
            blueBall = new JRadioButton("Blue"); // Blue choice
            ButtonGroup ballColour = new ButtonGroup(); // So only one colour can be selected at a tim
            ballColour.add(redBall);
            ballColour.add(greenBall);
            ballColour.add(blueBall);
            // Path
            archBall = new JRadioButton("Arch"); // Arch path choice
            archBall.setSelected(true); // Start as selected
            figureOfEightBall = new JRadioButton("Figure of eight"); // Figure of eight path choice
            ButtonGroup ballPath = new ButtonGroup(); // So only one path can be selected at a tim
            ballPath.add(archBall);
            ballPath.add(figureOfEightBall);       
            // Can split
            canSplit = new JCheckBox("Can split", false); // Initialy not selected
            selectedBallPanel.add(new JLabel("Select ball")); // Add components to selected ball panel
            selectedBallPanel.add(selectBall);
            selectedBallPanel.add(deleteBall);
            selectedBallPanel.add(new JLabel("Ball colour"));
            selectedBallPanel.add(redBall);
            selectedBallPanel.add(greenBall);
            selectedBallPanel.add(blueBall);
            selectedBallPanel.add(new JLabel("Path"));
            selectedBallPanel.add(archBall);
            selectedBallPanel.add(figureOfEightBall);
            selectedBallPanel.add(canSplit);
            // Add select ball drop down box action
            selectBall.addActionListener(new ActionListener() // Add selection listener to selectBall combo box
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    changeSelectedBall(selectBall.getSelectedIndex()); // Change the selected ball using the index from the select ball drop down box
            // Add delete button action
            deleteBall.addActionListener(new ActionListener() // Add selection listener to deleteBall button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    int tempIndex = selectBall.getSelectedIndex(); // Temp index
                    if (gameScene.getBalls().size() > 1) // If there is more than 1 ball left
                        gameScene.removeBall(tempIndex); // Remove ball
                        updateSelectBallComboBox(); // Update with new ball list
                        changeSelectedBall(tempIndex - 1); // Update interface with new current selected ball
            // Add radio button colour actions
            redBall.addActionListener(new ActionListener() // Add button listener to redBall button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (currentBall.getColour() != 0)
                        currentBall.setColour(0); // currentBall colour = red
            greenBall.addActionListener(new ActionListener() // Add button listener to greenBall button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                    if (currentBall.getColour() != 1)
                        currentBall.setColour(1); // currentBall colour = green
            blueBall.addActionListener(new ActionListener() // Add button listener to blueBall button
                public void actionPerformed(ActionEvent ev) // Background colour = blue
                    if (currentBall.getColour() != 2)
                        currentBall.setColour(2); // currentBall colour = blue
            // Add path radio button actions
            archBall.addActionListener(new ActionListener() // Add button listener to arch button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        currentBall.setPath(new Arch()); // Arch
            figureOfEightBall.addActionListener(new ActionListener() // Add button listener to figureOfEight button
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        currentBall.setPath(new FigureOfEight()); // Figure of eight
            // Add can split check button actions
            canSplit.addActionListener(new ActionListener() // Add button listener to can split
                public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
                        currentBall.setCanGiveBirth(canSplit.isSelected()); // Ball can split if can split check button is selected
            // Add components to ball panel
            ballsPanel.add(setAll);
            ballsPanel.add(newBallPanel);
            ballsPanel.add(selectedBallPanel);
            return ballsPanel;
         * changeSelectedBall
         * @param  ballIndexIn - The numbered index of the ball in the game scene list of balls. If less than 0 then equals 0. If more than ball list size then equals last ball
        public void changeSelectedBall(int ballIndexIn)
            if (ballIndexIn < 0) // Make sure index is within bounds
                ballIndexIn = 0;
            else if (ballIndexIn >= gameScene.getBalls().size())
                ballIndexIn = gameScene.getBalls().size() - 1; // Else put within bounds at either end
            currentBall.highlight(false); // Unhighlight current ball
            currentBall = gameScene.getBall(ballIndexIn); // Get new current ball
            currentBall.highlight(true); // Highlight new current ball
            // Update controls to new ball
            selectBall.setSelectedIndex(ballIndexIn);
            switch (currentBall.getColour()) // Update colour controls
                case 0: redBall.setSelected(true); break;
                case 1: greenBall.setSelected(true); break;
                default: blueBall.setSelected(true); break;
            if (currentBall.getPath() instanceof Arch) // If path is arch
                archBall.setSelected(true); // Update controls as arch
            else
                figureOfEightBall.setSelected(true); // Else figure of eight
            canSplit.setSelected(currentBall.canGiveBirth()); // Set if the ball can split or not
         * updateSelectBallComboBox
         * This method updates the combo box selection model with a new one made from the updated balls arraylist from the game scene
        public void updateSelectBallComboBox()
            DefaultComboBoxModel model = new DefaultComboBoxModel(gameScene.getBallList());
            selectBall.setModel(model);
    }Kind regards
    Liam morren

    http://docs.info.apple.com/article.html?artnum=301073
    This link states Mac OS X 10.4 now supports Java 5.0. It does mention nothing about Mac OS 9 or previous version of OS X. The problem you may be facing is that your Mac is running only 1.4.2 or less. The class files compiled for Java 5.0 can't run in non 5.0 versions of the Java Virtual Machine. Java 5.0 was a major release for the Java language and thus the change in numbering (though it took a little bit for this to change).
    Anyway you should confirm what version of Java you have installed on your Mac.
    At a command prompt:
    java -version
    The above URL states that the previous 1.4.2 Java version is not uninstalled, and this could still be the preferred version to use for Java applications even after installing Java 5.0.
    The URL above states there is a utility to set your apps to use Java 5.0 as the perferred Java version. Who knows maybe this is all you need to do. I hope this is the case, then it probably is an easy fix, otherwise you may need to rewrite your app in Java 1.4.2 to get it to run on your version of Mac.

  • Getting Applet to Work in an HTML Document

    I have written an Applet which works perfectly in the Applet Viewer, but crashes when I attempt to put it on my web page. The crash gives no errors, no exceptions, no nothing. Just a grey square with the words "Applet Crashed". I tried it both with the files in a .jar,and with all the files uncompressed, and used the W3C's code validator at http://validator.w3.org/ to verify that my HTML is correct.
    The HTML code using the .jar file is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <a bunch of HTML code>
    <object data="ComicTemplate.class" type="applet/java" archive="AICS.jar" WIDTH=620 HEIGHT=650>
    If you can read this, your broswer doesn't support Java. Go to Sun's website to get the latest version of Java. You may also need to turn on Java in your browser's preferences.
    </object>
    <more HTML>
    </html>
    The code without the .jar is the same, except that the archive lists the 8 .class files and 18 images used individually.
    Any advice?

    I tried it both ways. It works using either method in the applet viewer, but niether works in the browser.
    In the good news, however, I found a hidden Java console inmy browser, which did have some error messages. Cut-n-pasted:
    -- Opera Java Console --
    Java vendor: Sun Microsystems Inc.
    Java version: 1.4.1_02
    type 'h' for help
    java.security.AccessControlException: access denied (java.io.FilePermission Hunter.jpg read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
         at sun.awt.SunToolkit.getImageFromHash(SunToolkit.java:486)
         at sun.awt.SunToolkit.getImage(SunToolkit.java:500)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:81)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
         at Panel1.<init>(Panel1.java:24)
         at Comic.<init>(Comic.java:22)
         at ComicTemplate.<init>(ComicTemplate.java:26)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:306)
         at java.lang.Class.newInstance(Class.java:259)
         at com.opera.PluginPanel.run(PluginPanel.java:412)
         at java.lang.Thread.run(Thread.java:536)

  • How to show a html page in a swing applet -- URGENT!!!

    Hi All,
    I'm trying to show a html page inside a swing applet... is it possible to do that?? if so is there any built-in classes available for that?? If anyone have some examples, plz help me with that....
    Thanks,
    Ragu

    i havent tested.. but this should work. i am no expert on these either, just to give you an example.. :-)
    JEditorPane ePane = new JEditorPane();
    HTMLEditorKit html = new HTMLEditorKit();
    ePane.setEditorKit(html);
    HTMLDocument htmld = new HTMLDocument();
    try{
    URL url = new URL("http://hcs.harvard.edu/~undercon/");
    InputStream ins = url.openStream();
    ePane.setDocument(htmld);
    html.read(ins,htmld, 0);
    this.getContentPane().add(new JScrollPane(ePane),BorderLayout.CENTER);
    catch(Exception e)
    e.printStackTrace();
    }

  • PDF document in a Swing Applet?

    How can you display a PDF document in a Swing Applet?

    I have implemented a document archiving solution that provides a Swing UI to search a database for available documents. All the documents in the archive are in the PDF format. To accomplish this I use an html frameset where a Swing applet is displayed in one frame and the PDF document is displayed in the lower frame. I use LiveConnect to have my javascript communicate with the applet. My applet calls a javascript function that causes the URL of the lower frame point to the PDF document. This works fine, but I would rather use an all Java UI instead of depending on the browser and javascript.
    How can we get Adobe or Sun to address this need?

  • Which command i use to run SWING APPLET

    Hi friends,
    i m a new in swing technology i got and problem when i run swing applet .
    i make a file and complie it with -deprecation it work and make a .class file but how can i run this applet [i use jview command , appletviewer command but it can't work]
    i hope that someone hellp me.

    Just as a matter of interest and i know its a stupid question, but did you create a html file to access the class file/jar
    Here is some example code of an applet html page
    Hope it helps...
    Also have you put it in a Jar file?
    <html>
    <head>
    <title>(Whatever title youu want)</title>
    <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
    <TR>
    <APPLET CODE = "ClassName.class" ARCHIVE = "JarName.jar" WIDTH = "800" HEIGHT = "600"></XMP>
    <PARAM NAME = CODE VALUE = "ClassName.class" >
    <PARAM NAME = ARCHIVE VALUE = "JarName.jar" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="scriptable" VALUE="false">
    <dont worry about this>(they just variables for my applet)
    <PARAM NAME = SERVER_IP VALUE ="192.1.1.209">
    <PARAM NAME = SERVER_PORT VALUE =8701>
    <PARAM NAME = DEBUG VALUE =true>
    <PARAM NAME = REFRESH VALUE =10000>
    <PARAM NAME = TAIL_REFRESH VALUE =2500>
    <PARAM NAME = MESSAGE_TIMEOUT VALUE =60>
    </dont worry about this>
    </APPLET>
    </body>
    </html>

  • Swing Applets and javascript

    I'm writing a swing applet to do some rich text editing, mainly bolding, italicizing, etc as well as support for special characters (greek letters, etc). Rather than using the HTMLEditor kit (which I've heard suspect things about), I am going through the document tree and creating a corresponding HTML version of the string (inserting HTML entities based on position in the document). I am planning on exposing these to the client via javascript, but I have run into some problems with document.applets.appletName.publicMethodName. I've gotten this to work on IE for the PC. I am aware that there are some issues with the Sun plug-in for Netscape on PC. An additional complication is that this needs to work on a Macintosh as well. Does anyone know if the MRJ plugin supports this behavior (for both IE and Netscape)? Is there a better way to go about doing this, rather than using javascript to expose the HTMLized version of the string? Thanks in advance.
    Tim

    You must to check if the mrj plug-in is the same version to the jre1.3, because the jre 1.3 supports the javascript events. other way is incorporate in your applet the javascript class, in the next web page you will find the js.jar http://www.mozilla.org/rhino/download/
    if you have troubles write me to
    [email protected]
    good luck
    Carlos Sanhueza
    Santiago de Chile

Maybe you are looking for

  • Double charge to bank account, amount never arrive...

    My HSBC bank account was charger TWICE the 7th May, 8.50 and 8.69 pounds, because of the rates varied from € to £ and the amount has never arrived to my Skype account. Where is it and how can I get it back? Dumb auto-recharge is now disabled and my a

  • Wrong assignment field (ZUORN) running MR08

    Hi all, On SAP R/3 4.6b we run transaction MR01 with unplanned delivery costs. As we have some price differences, the FI document has a line with the right price diff. G/L account. This G/L account has its sort key field (ZUAWA) filled with code '013

  • Adding an iWeb hyperlink under my .mac mail signature

    Two question: 1) I have tried to incorporate my new iWeb address into my .mac mail signature but it will only 'grab' a certain number of characters. It leaves off the last 3 or 4. How do I remedy this? 2) I have two .mac addresses on my .mac account.

  • Facebook app won't work.

    I just got my phone a few days ago. I download the facebook app today and it says that i'm on a service plan that does not support that application, but I have the Blackberry Social add-on.

  • Looking for a link to enable me to download previous versions of Firefox for support/troubleshooting purposes

    My team tests an enterprise e-commerce site and I'm looking for a link to download previous versions of Firefox so we can work trouble tickets that come in against specific versions of the browser