Swing applets don't display

I'm having no success getting my applets that use swing components to display in my web browser. I've read some forum posts about similar problems and they all talk about downloading the JRE. I already have the latest version and no change. I'm led to belive it is because some browsers do not support Java 1.3 but this can be overcome by using a JAR archive. I'm not familiar with this. How do I get my applets to show?
Thanks in advance

All you have to do is put your HTML file thru the HTMLConverter by typing:
HTMLConverter test.htm
where test.htm is the name of your HTML file which should contain an <APPLET> tag like this:
<APPLET CODE="MyApplet" CODEBASE="." WIDTH=200 HEIGHT=100></APPLET>
Note that the above is just a sample with bare minimum for an applet. Note also that the HTMLConverter should come with your JDK1.3 but if you can't find it on your system, you may have to download it from Sun's web site.
V.V.

Similar Messages

  • Sun Java Console & Applets don't display properly on JRE 1.5.0_05

    Duplicate Post as it was equally relavant to this forum: [http://forum.java.sun.com/thread.jspa?threadID=666689&tstart=0 ]
    Hi,
    We have a signed applet based application hosted on weblogic server. We are trying to launch the application on IE 6.0, JRE 1.5.0_05.
    When we try to see the Sun Java Console from IE's Tools Menu bar, we don't see any text in the window and also the side bars & buttons ("clear", 'copy", "close") are not rendered properly. Now if we, try to bring the focus to text area of Sun Java Console, and try to select all (Ctrl+A), we only see some text selected, but not what it is. Now if we copy the text onto the notepad, we can see the text.
    Next, when we try to launch the signed applet based application, we get the security warning, where only we can see the dialogue box and not the text or buttons. By randomly clicking on this security dialogue, if we hit on yes, the Applet based application is launched. The UI is totally off color; either you see some widgets on application partially or totally blackened or in different colors. Application basically looks to be in chaos.
    This behavior is not observed in any of the previous JRE versions, i.e. JRE 1.5.0_04 or any previous versions. Interesting part is after uninstalling JRE 1.5.0_05, if we install 1.5.0_04; problem persists, but not in JRE 1.4.
    We have observed the same behavior on number of machines. Is it a known issue? What�s the reason & solution?
    Thanks in Advance,
    Vinayak

    When we try to see the Sun Java Console from IE's
    Tools Menu bar, we don't see any text in the window
    and also the side bars & buttons ("clear", 'copy",
    "close") are not rendered properly. I suspect you're running into graphics issues. Perhaps java5 is trying to optimize too much, and you have older or buggy Windows drivers.
    Try:
    * getting the latest graphics drivers for your hardware from your vendor and installing them.
    If that doesn't work, try
    * putting options like "-Dsun.java2d.noddraw" in the Java Control Panel as the default VM options for your Java.
    That's actually a bit aggressive - you can start with, say, "-Dsun.java2d.d3d=false" or "-Dsun.java2d.ddoffscreen=false" (each of these is less drastic than noddraw).
    Then make sure you quit all IEs, and restart one.

  • JFC Swing Applet

    Hai Friends,
    I am using jdk1.3.1 and all my applications using JSwing run well. But if i make an applet using Swing, it could be compiled well, but my browser IE5.5 does not run my Swing Applet, instead it displays javax.swing.JApplet not found. I don't know how to make my Swing Applet work.
    Please kindly help me. Thank u.

    Well, have you converted your html, with applet tag, with Java Plug-in HTML Converter? If not, you should try. You can download it from sun's web site.
    lala

  • Swing based applets don't run in browser !!!

    whenever i run a swing based applet from the browser (IE 5), the applet is not displayed in it - status bar shows that the class file was not found
    so please tell me the solution
    thanx in advance!

    You just have to download Sun JVM to run swing JApplet in your browser(IE).
    get it at the following address:
    Just follow the link, and download dialog will be appeared just save the file to you hard drive, and install the software.
    The file name will be : "j2re-1_4_1_02-windows-i586-i.exe"
    http://java.sun.com/webapps/download/AutoDL?BundleId=7544
    after successfull installation you'll find the new plugin
    "java2 v1.4.1_02 for<applets>"
    in Tools>InternetOptions>Advance
    you have to check it(if unchecked) to enable the JApplet to be loaded in your browser.
    Another new option you'll find in your Tools menu "Sun Java Console". From it you can find what exceptions are thrown while the applet is loaded

  • Displaying Swing Applets

    Hey I am unable to dispay my JApplet in any browser
    an error message" Load class not found is displayed in IE& Class already loaded is displayed in Netscape" but my Japplet is working fine with applet viewer
    Any gurus out there to solve this problem
    Thanks in advance
    Neti

    Special quotations have to included in your html file for the applet to be displayed in IE.
    There is a tool called HTMLConverter which you can download from the java.sun.com website.
    Here is the sample code required, if u can write it yourself:
    <HTML>
    <HEAD>Applet Examples
    </HEAD>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.3 -->
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 200 HEIGHT = 200 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <PARAM NAME = CODE VALUE = "Ovals.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="scriptable" VALUE="false">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.3" CODE = "Ovals.class" WIDTH = 200 HEIGHT = 200 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    <!--
    <APPLET CODE = "Ovals.class" WIDTH = 200 HEIGHT = 200>
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </HTML>

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Swing Applet in JSP: problem with fetching data from database

    i am facing a problem while fetching data from database using Swing Applet plugged in a JSP page.
    // necessary import statements
    public class NewJApplet extends javax.swing.JApplet {
    private JLabel jlblNewTitle;
    private Vector vec;
    public static void main(String[] args) {
    JFrame frame = new JFrame();
    NewJApplet inst = new NewJApplet();
    frame.getContentPane().add(inst);
    ((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
    frame.pack();
    frame.setVisible(true);
    public NewJApplet() {
    super();
    initGUI();
    private void initGUI() {
    try {
    this.setSize(542, 701);
    this.getContentPane().setLayout(null);
    jlblTitle = new JLabel();
    this.getContentPane().add(jlblTitle);
    jlblTitle.setText("TITLE");
    jlblTitle.setBounds(197, 16, 117, 30);
    jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
    jlblNewTitle = new JLabel();
    this.getContentPane().add(jlblNewTitle);
    Vector vecTemp = getDBDatum(); // data fetched fm DB r stored here.
    jlblNewTitle.setText(vecTemp.get(1).toString());
    jlblNewTitle.setBounds(350, 16, 117, 30);
    jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));
    } catch (Exception e) {
    e.printStackTrace();
    }//end of initGUI()
    private Vector getDBDatum() {
    // fetches datum from oracle database and stores it in a vector
    return lvecData;
    }//end of getDBDatum()
    }//end of class
    in index.jsp page i have included the following code for calling this applet:
    <jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
    width="600" height="300">
    <jsp:fallback>Could not load applet...</jsp:fallback>
    </jsp:plugin>
    if i view it in using AppletViewer it runs perfectly and display the data in JLabel. (ie, both jlblTitle and jlblNewTitle).(ie, DATA FETCHES FROM db AND DISPLAYS PROPERLY)
    BUT IF I CLICK ON INDEX.JSP, ONLY jlblTitle APPEARS. jlblnNewTitle WILL BE BLANK(this label name is supposed to fetch from database)
    EVERY THING IS DISPAYING PROPERLY EXCEPT DATA FROM DATABASE!!!
    i signed the applet as follows :
    grant {
    permission java.security.AllPermission;
    Can any body help me to figure out the problem?

    This is the Swing Applet java code
    import java.awt.Dimension;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Vector;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.JScrollPane;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTree;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.SwingConstants;
    public class HaiApplet extends javax.swing.JApplet {
         private JLabel     jlblTitle;
         private JLabel     jlblNewTitle;
         private Vector     vec;
         * main method to display this
         * JApplet inside a new JFrame.
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              NewJApplet inst = new NewJApplet();
              frame.getContentPane().add(inst);
              ((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
              frame.pack();
              frame.setVisible(true);
         public HaiApplet() {
              super();
              initGUI();
         private void initGUI() {
              try {               
                   this.setSize(542, 701);
                   this.getContentPane().setLayout(null);
                        jlblTitle = new JLabel();
                        this.getContentPane().add(jlblTitle);
                        jlblTitle.setText("OMMS");
                        jlblTitle.setBounds(197, 16, 117, 30);
                        jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
                        jlblTitle.setHorizontalAlignment(SwingConstants.CENTER);
                        jlblTitle.setForeground(new java.awt.Color(0,128,192));
                        jlblNewTitle = new JLabel();
                        this.getContentPane().add(jlblNewTitle);
                        Vector vecTemp = getDBDatum();
                        jlblNewTitle.setText(vecTemp.get(1).toString());
                        jlblNewTitle.setBounds(350, 16, 117, 30);
                        jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));     
              } catch (Exception e) {
                   e.printStackTrace();
         }//end of initGUI()
         private Vector getDBDatum() {
              Vector lvecData = new Vector(10,5);
              Connection lcon = null;
              Statement lstmt = null;
              ResultSet lrsResults = null;
              String lstrSQL = null;
              String lstrOut = null;
              try {
                   OmmsDBConnect db = new OmmsDBConnect();
                   lcon = db.connectDb();
                   lstmt = lcon.createStatement(lrsResults.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
                   lstrSQL = "select DT_ID from P_DATATABLES";
                   lrsResults = lstmt.executeQuery(lstrSQL);        
                   int i = 0;
                   lrsResults.last();
                   int length = lrsResults.getRow();
                   System.out.println(length);
                   lrsResults.beforeFirst();
                   int recCount = 0;
                   while (lrsResults.next()) {
                        recCount++;
                        lvecData.addElement(new String(lrsResults.getString("DT_ID")));
                   //     System.out.println("ID :  " + lrsResults.getString(1));
                        i++;
                   }System.out.println("here 3 out fm while");
              catch(SQLException e) {
                   System.out.print("SQLException: ");
                   System.out.println(e.getMessage());
              catch(Exception ex) {
                   lstrOut = "Exception Occured " + ex.getMessage();
              finally {
                   try {
                        lrsResults.close();
                        lstmt.close();
                        lcon.close();
                        System.out.println("[DONE]");
                   catch(Exception e) {
                        System.out.println(e);
             }//end of finally
              return lvecData;
         }//end of getDBDatum()
    }//end of classOfcourse the above code compiles and runs well. in Applet Viewer
    I plugged the above Swing Applet in a JSP page index.jsp
    <jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
                   width="600" height="300">
         <jsp:fallback>Could not load applet...</jsp:fallback>
    </jsp:plugin>Every thing is working fine in AppletViewer...But if i view this in any browser, then only the jlblTitle is displaying. jlblNewTitle is not displaying(this label name is actually fetching from thedatabase)
    can any body help me regarding this matter.? Thx in Advance.

  • 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

  • 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?

  • Swing applet view problem in IE

    Hi,
    I am new to Java and have to develop a web enabled tool where the servlets in my Solaris-Tomcat web server is manipulating with data in an oracle database. The client code is on Swing Applet, which is to be opened in Internet Explorer 5.5 from Windows NT platform.
    In view of this, I have written a small swing applet and it is not opening in IE. I heard that I need to use HTML converter to run Swing applets in IE. But, Is it enough to download the HTML converter for Solaris and install it in the server and convert the html pages where <applet> tag is included? Or , do I need to install the HTML converter for windows to all the client machines?
    Please help. This is very urgent.
    Thanks in adance.

    You can use this html code :
    <html>
         <body>
              <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 695 HEIGHT = 525 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
                   <PARAM NAME = CODE VALUE = MyApplet >
                   <PARAM NAME = CODEBASE VALUE = "." >
                   <PARAM NAME = ARCHIVE VALUE = "MyApplet.jar" >
                   <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
                   <PARAM NAME="scriptable" VALUE="false">
              </OBJECT>
         </body>
    </html>
    replacing only the dimension, the code value and removing or modifying archive value.
    Don't modiy the classid. This code indicates to the browser to use the Sun Java VM instead of its own vm.
    I hope this helps,
    Denis

  • Swing Applet Repainting during moving window

    Hi,
    I've run into a problem with my swing JApplet. One of the elements of my GUI is a JLabel that contains a single Image. After the GUI is created, a seperate thread changes the image and prompts the JPanel containing the JLabel to repaint().
    Now, this works perfectly with the AppletViewer using java 1.4.2.03. However, when I run the applet through Microsoft's Internet Explorer using Sun's VM 1.4.2.03 plugin, I notice a problem. If I take the window containing the applet and (assuming it is NOT maximized) move it around the screen, the JLabel's image will not always be drawn at the correct place. It will often overlap some of the other GUI elements.
    I read something that Threads and Applets don't mix which suggested using the SwingUtilities.invokeLater() function, but I need this Thread to sleep() and didn't know how to make it do so because I never see the Thread class through the invokeLater() method.
    It solves the problem if rather than have the JLabel repaint itself, I have the entire applet repaint itself, but this is not the ideal solution. Is there any way to determine when the window containing the applet is being moved and then force the applet to repaint itself entirely? Am I going about this wrong? Any help would be greatly appreciated!
    Thanks,
    B. Danny K.

    The content pane of a JApplet is a JPanel. So you need to use the getContentPane() method and cast the Compnent to a JPanel before you can use revalidate(). However, as you have discovered 99% of the time a validate() also works.
    Note, that is you are using a BorderLayout then you should be removing the old component before adding the new component.

  • Swing Applet question

    I would like to know why the look and feel for Swing applet (especially, Text information embedded in JPanels) are different on Windows 2000 and XP embedded versions. The text information is left aligned in XP embedded when the same is centrally aligned in the 2000 version. In XP embedded, the applet is expanding beyond the screen size bounds. Is there anything I can do so that look and feel are the same in both these OS's.
    Regards, Scr

    nitroniouz wrote:
    (which don't work when you click on them)Are they freeze? The buttons don't react to the clicks or they seam to work but don't execute the expected function?
    I think that your actSignup actionPerfomed methos is not working well or it's taking too long to execute and you're blocking the EDT.
    Try to create a separate thread to do the database task, a SwingWorker may help you. Take a look at the [Cocurrency in Swing Tutorial|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html].
    Regards,
    Henrique Abreu

  • Swing applet -- applet communication

    I've got a swing applet having diffculties interacting with javascript. I had the same thought of adding a "normal" applet and let them do the stuff while javascript accesses the "normal" one without problems.
    but there's a hook: since both applets lay in different jvm - one in plugin, the other in plain browser jvm - they don't "see" eachother.
    does anyone know how to solve this problem?
    thank you very much in advance.

    maybe I should be more specific:
    the swing applet uses the jfc plugin to load. the other one uses the "plain" browser jvm.
    listing applets with appletContext.getApplets() in both applets just list themselfes. obviously because they are in 2 different jvm.
    how can I access the normal one from the swing-applet and vice versa?
    thank you. appreciate any help.

  • Run swing applet without installed plug-in

    Is any possible way to run swing applet without installed java plug-in? Does exist way how to load swing classes from server?

    Is any possible way to run swing applet without
    installed java plug-in? Does exist way how to load
    swing classes from server?It is impossible to run a swing applet without the plug-in.
    There may be a solution : include the swing library in your applet,
    so you don't need the plugin anymore (personnaly i prefer having
    the plugin downloaded once and the use it as needed).
    For the load from a server you will need to be more specific, but
    don't forget : the applet don't run on the server, so it won't request
    Swing classes from the server.

  • 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?

Maybe you are looking for