Swing in Applets

Hi,
I can use awt components in my applets no problem, but when ever I put swing components in
they work in the appletviewer, but not in the browser.
My code in the applet is fine, all necessary javax libraies included, etc. The code in the HTML file is correct.
I am using IE 5.5, I have SDK1.3.
Do I need any additional plugins for using swing? If so has anyone got a link?
Can anyone help, as no one at my university, can help me.
thnx in advance.

Your browser is probably configured to use the Microsoft JVM, which is older and doesn't have the swing classes (probably). To use Sun's java plug-in, make sure you are using the <OBJECT...> tag, not the <APPLET...> tag.

Similar Messages

  • Running the Swing based applet in html

    Hi
    I am getting problem while runing a swing based applet in html. If i am using eclips and run my file as java applet it is working fine.
    For testing purpose, my html and all jars are in the same folder where my applet class is reside.
    Also i am not getting any error in html..
    Please help

    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

  • Swing based applet communication with javascript

    Hi
    In my browser based application, the GUI has two part one contains the swing based applet and other is html based text area. Applet contains the list of text files.
    My requirements is that if user double clicks on a file the, text area should display the name or path or content of file. I facing problem at very first level, how to capture the swing event in java script of browser?
    Thanks in advance!!! :)

    Hi
    In my browser based application, the GUI has two part one contains the swing based applet and other is html based text area. Applet contains the list of text files.
    My requirements is that if user double clicks on a file the, text area should display the name or path or content of file. I facing problem at very first level, how to capture the swing event in java script of browser?
    Thanks in advance!!! :)

  • 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

  • Converting Swing to Applets

    Hello
    I have a swing GUI and my employer asked me to convert the whole thing into applets. I just wonder if there is a simpler way of doing it. My GUI now contains only basic swing components like JTabbedPane, JTable etc...,
    Thanks.

    There may also be resource and security issues associated with the conversion. On the whole modifying the entry point is fairly simple ... convert to JApplet, make sure you have an init method to replace the main method as your entry point. You will need HTML to start the applet.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Awt  V Swing in applets ???

    I've written an applet using Swing but I'm having huge problems trying to get it to run in Internet Explorer (even though it works in the Applet viewer).
    Someone suggested rewriting it using awt so that users with older browsers don't have to download a plugin to be able to view it? Is it necessary to download a plugin to view applets with Swing? Is this better to avoid using packages like Swing if possible, in your opinion? Please let me know what you think - I would like as many people as possible to be able to see the applet on their browsers.
    Thanks for your time.

    It's because of Microsoft and Sun falling out over Java, effectively Microsoft couldn't/wouldn't move beyond 1.1 which was AWT based. At some point in the not too distant future they will remove all Java support so at that point you will be reliant on a plug-in to get to the IE base.
    At the moment, if you've already done some AWT work and the GUI is simple, I'd stick with it, otherwise go to Swing and the plug-in. This is of course subjective, others would disagree strongly with me.
    Answer provided by Friends of the Water Cooler. Please inform forum admin via the 'Discuss the JDC Web Site' forum that off-topic threads should be supported.

  • AWT vs Swing vs Applet

    Hi there,
    I'm currently writing a chess game and I'm wondering which would be best to use - AWT, Swing or an applet. I read that using Swing in an applet is not advisable as the classes that would need to be downloaded could be quite large and so take quite a long time. I've been writing it using AWT as I feel that it is fairly simple to change it to Swing or to an applet. What are your opinions on this?
    Many thanks!

    I'm currently writing a chess game and I'm wondering
    which would be best to use - AWT, Swing or an applet.Applets are not separate from AWT or Swing. The Applet class forms part of the AWT package, and JApplets are the Swing equivalent. If you were to use an Applet (or JApplet), you would still have to use AWT/Swing classes, such as Panel, Button etc. for the UI for your program, unless you want a mysterious magical grey box ;P
    I read that using Swing in an applet is not advisable
    as the classes that would need to be downloaded could
    be quite large and so take quite a long time. I don't have a lot of experience using the AWT classes, and use the newer Swing ones. I have heard Swing is easier to use, but many browsers do NOT support Swing classes as standard (particularly Internet Explorer), and require the plug-in, which is a fairly hefty download, especially on a dial-up.
    I've been writing it using AWT as I feel that it is fairly
    simple to change it to Swing or to an applet. What are
    your opinions on this?You say you are using AWT at the minute - are you writing the program as an application? If so, then I'm assuming you have the program running in a Frame, and to use the program as an applet, you would want to change your class from extending Frame to extending Applet. There shouldn't be a lot of change to code when adding components, but you will need to implement Applet methods (such as init()).
    Just note that in order to use the program on a webpage, it must be an applet. If you want to use the program as an applet, seeing as you have already started by using AWT, you might as well stick with it as you would be putting in effort to convert it into Swing only to restrict the potential audience.
    If you want the program to run as an application AND an applet, then the class extending Applet can have a main method, which creates a Frame, before adding a new instance of your applet and calling its init method.

  • Long during for download swing using applet

    Hello,
    i'm programming an applet using SWING component, but the user must download swing library before using. This download is long during on dialup internet access on 56K modem because size is over 8 megabytes.
    is it possible to reduct the jar file to download once class using ?
    and how ?
    what filename of this jar file ?
    Thanks for all

    What does you jar contain? The "real" swing.jar has some 1.8-1.7 megs, not around eight. I can't find it anywhere on this site so you'll need google... here's one possibility: http://webmail.fishnet.com/applets/swing.html (don't know what it contains)

  • How can i connect multiple forms using swings or applets(AWT) & with D-Base

    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,

    sreedharkommuru wrote:
    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,There is no magic, you need to spend a good amount of time in tutorials, here is a good one to start off with:
    [The Really Big Index|http://java.sun.com/docs/books/tutorial/reallybigindex.html]
    Here are a few tips:
    1 - Do not mix AWT and SWING: it'll just cause you headaches in the long run that you cannot fix without refactoring to properly not mix the 2 together.
    2 - You use JDBC to access the database
    3 - You make accessors/constructors to pass parameters that you need from one form to another.
    Have fun.

  • Re: HELP - ON BROWSER, Applets, JMF & Swings & Plugins  - Applet deployment

    hiiiiii,
    plz send me ur working code of media player in java .i need this for my major project.i m facing problem with media package .
    thnx.

    Oh, I see. IE makes you use the Information Bar:
    IE 6 has an "Informat Bar" that appers at the top of the HTML content.
    When I copy and compile your example in a temporary directory and enter the URL in IE6:
    C:\temp\WelcomeApplet.html
    There is a message:
    TItle: Information Bar
    Did you notice the information Bar?
    The Information Bar alert you when Internet Explorer block a
    pop-up window or file download that might not be safe. If a
    Web page does not display properly, look for the information
    Bar (net the top of your browser)
    [Checkbox] Do not show this message again.
    (link) Learn about the Information Bar
    (button) OK
    I click OK
    and the Information Bar says:
    To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options...
    I click on the Information Bar and a context menu appears:
    Allow Blocked Content...
    What's the Risk?
    Information Bar Help
    I choose Allow Blocked Content...
    Title: Security Warning
    Allow active content such as script and ActiveX controls can be useful,
    but active content might also harm your computer.
    Are you sure you want to let this file run active content?
    Yes/No
    I choose Yes
    It works for me in IE 6

  • 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

  • Calling a WebService from Java Applet

    Hi all,
    In my application I have 3 projects:
    1. server - for all the business logic.
    2. view - for web app.
    3. swing - for applet.
    In the view project I wrote a WS, and I want to call it from my applet. So I created a WS using the Jdev (10.1.3.2) wizard in the view project (I tested it and it worked fine), and in the swing project I created a proxy for this WS, tested it and it worked fine. Then I created a JAR containing the swing project with the WS proxy classes, opened the Applet and find out that I have some classes missing, so I started adding all the relevant Jars and ended with a ~13MB JAR containing all the swing project jars that in the class path for a simple Applet.
    I know that I'm missing something but I dont know what. Do I really need all those Jars. Is there a simple way to call to a WS via Applet?
    This is the list of all the Jars:
    activation.jar
    commons-logging-api.jar
    commons-logging.jar
    ejb.jar
    http_client.jar
    jaxb-api.jar
    jaxb-impl.jar
    jaxen.jar
    jaxr-api.jar
    jaxrpc-api.jar
    jazncore.jar
    jdom.jar
    jms.jar
    jta.jar
    mail.jar
    mdds.jar
    oc4jclient.jar
    ojdl2.jar
    ojmisc.jar
    ojpse.jar
    oraclepki.jar
    orajaxr.jar
    orasaaj.jar
    orawsdl.jar
    orawsrm.jar
    osdt_cert.jar
    osdt_core.jar
    osdt_saml.jar
    osdt_wss.jar
    osdt_xmlsec.jar
    relaxngDatatype.jar
    saaj-api.jar
    saaj-impl.jar_old
    servlet.jar
    wsclient.jar
    wsdl.jar
    wssecurity.jar
    wsserver.jar
    xdb.jar
    xml.jar
    xmlparserv2.jar
    xsdlib.jar
    By the way at the end of all this annoying process I got the next exception:
    [failed to localize] typemapping.nested.exception.initialization(javax.xml.rpc.JAXRPCException: javax.xml.soap.SOAPException: Unable to create SOAP Factory: Provider com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl not found)
         at oracle.j2ee.ws.client.BasicService.createLiteralMappings(BasicService.java:282)
         at oracle.j2ee.ws.client.BasicService.createStandardTypeMappingRegistry(BasicService.java:244)
         at com.tm.view.ws.misc.runtime.WSMisc_Service_SerializerRegistry.getRegistry(WSMisc_Service_SerializerRegistry.java:26)
         at com.tm.view.ws.misc.runtime.WSMisc_Service_Impl.<init>(WSMisc_Service_Impl.java:26)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:92)
         at oracle.j2ee.ws.client.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:121)
         at com.tm.view.ws.misc.WSMiscSoap12HttpPortClient.<init>(WSMiscSoap12HttpPortClient.java:20)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at client.base.connectivity.ClientRequestAgent.runWS(ClientRequestAgent.java:135)
         at client.base.connectivity.ClientRequestAgent.run(ClientRequestAgent.java:44)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Shachar

    Try this:
    1. open the webService data controll in the Data Controls section and drag the method from the webService onto the method call activity in your task flow. This will overwrite the current method property (the one which pints to your bean, make a copy of this entry if you can't reproduce it by hand). This too will create an entry in the pageDef of the method call activity.
    2. reenter (or paste) the original value in the method property, so that it again points to your bean. The entry in the pageDef will remain!
    3. now in the bean method you can access the method via its binding like you access any other method from the binding:
    // GET A METHOD FROM PAGEDEF AND EXECUTE IT
    // get the binding container
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    // get an Action or MethodAction
    OperationBinding method = bindings.getOperationBinding("YourMethodActionNAME");
    if (method == null)
    // handle method not found error...
    // if there are parameters to set...
    Map paramsMap = method.getParamsMap();
    paramsMap.put("param","value")  ;    
    // execute the method
    method.execute();
    List errors = method.getErrors();
    if (!errors.isEmpty())
       // handle errors here errors is a list of exceptions!
    // no error resume normal workTimo

  • Can anyone tell me why javaFX better than applet?

    I just have read the example of javaFX.And I have a question.
    From the example.I don't see any good in javaFX.below is my opinion:
    1.It seems like that the javaFX application is deploy as a applet or jnlp.This is what swing can also do;
    2.javaFX's expression is sucks.Why don't use xml to declare the UI? I think as the application becomes larger,it is so difficult to maintain the project.But if I use swing or applet,I think it is better for me to maintain the project using oop.
    3.I think what javaFX can do is also can be done by swing,why javaFX?
    any apply is appreciated,thanks very much

    Hi
    1. JavaFx it is build over the Java2D and Swing. In fact it can not run without this 2 component ( at least now ). So what you can do in JavaFX you can also do on Swing and Java2D
    2. I don't think xml syntax it is good to describe stuff like this . XML was design to store data not actions. When you design user interface you must declare what components or shape do you want to draw on the screen but also you must write the interaction between them . I don't think you can do this easy and nice in XML. Look at the Flex approach . They used for declaration of the GUI an XML and for comportment ActionScript. I don't like this because i must learn and study two "languages" to make a GUI.I've preferred one language.As you said it is better to use OOP . How can you do OOP in XML in a nice way ?
    3. Because in JavaFX we do can more things easily . Look at this example : [http://silveiraneto.net/2008/07/31/javafx-creating-a-sphere-with-shadow/] . I don't think you can achieve the same results with Swing and Java2D with the same code line number.
    Another difference between JavaFX and Swing is the syntax. The Sun want to create a language that can be used by designer and by programmer . The Swing can not be used by a designer . JavaFX used a more natural syntax. For example if you want to insert a shape in an array you must type in JavaFX :
    insert Circle{radius:10} into array_variable . As you see it is more natural this syntax than Java equivalent.
    Another difference it is how easy you can do things in JavaFX correctly . When you program in Java2D and Swing you must know very good the architecture of this components if you want to work correctly . You must know what is the Event Dispatch Thread and how you can used it . You must how you can work with multiple threads in Java2D and Swing . In JavaFX you don't need this . All of the tricks it is done by JavaFX ( not in this release . I hope the final release it will contains all these tricks) .
    Best regards
    Andrei Dore

  • How to set swing to support using vrml/external/browser ?

    When doing applets with AWT to call vrml/external/browser.getbrowser, it works. But if update to use swing instead of awt, applets always cannot say: java.lang.NoClassDefFoundError: vrml/external/Browser.
    The html file containing this applet is converted by command : java HTMLConverter **.html .And also using java1.3.1plug-in.
    But if removing java plug-in and add ---ARCHIVE="Swing.jar"---- into **.html source code without using java HTMLConverter. The applet works.
    While, this way can let applet work, but thus, the applet cannot connect to mysql database.
    So, anyone knows how to set up swing in applet when using converted **.html with javaplugin? ???
    Thanks so much!!!!

    Hi David,
    Need more info:
    Version of Crystal Reports are you using?
    Visual Studio version?
    Try with this:
    The following C# code demonstrates the use of the ExportToStream method:
    ReportDocument report = new ReportDocument();
    report.Load("c:\\temp\\test.rpt");
    ExportOptions options = new ExportOptions();
    options.ExportFormatType = ExportFormatType.PortableDocFormat;
    options.FormatOptions = new PdfRtfWordFormatOptions();
    ExportRequestContext req = new ExportRequestContext();
    req.ExportInfo = options;
    Stream s = report.FormatEngine.ExportToStream(req);
    Response.ClearHeaders();
    Response.ClearContent();
    Response.ContentType = "application/pdf";
    s.Seek(0, SeekOrigin.Begin);
    byte[] buffer = new byte[s.Length];
    s.Read(buffer, 0, (int)s.Length);
    Response.BinaryWrite(buffer);
    Response.End();
    Regards,
    Shweta

  • Using SWING and EJB

    Had nebody used Swing for GUI and EJBs for business logic. HEre i need to use Swing for gui rather than JSPs.
    Can nebody help??

    My question is ...
    How do u call EJBs from swing based applets..
    In J2EE transaction management cud be done at server side but how will we manage with the swing app??

Maybe you are looking for

  • Error while exporting a table - EXP-00091

    I am doing an export of a table. The table has 1000838 rows. After the export is completed, when I checked the log - it said Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning option JServer Release 9

  • Menu Buttons Change Image instead of Highlighting?

    Does anyone know how to/or if it's possible to make a DVD menu in Photoshop for Encore where, when the menu button is highlighted it actually changes image instead of making it a solid highlighted colour? For example... In a DVD i'm making, I have Ca

  • Mail Messages disappear out of my inbox mysteriously since update 10.5.3

    Hi together Since the update to 10.5.3 my Mail program doesn't work proberly anymore. I loose messages from my inbox (read and unread ones) and I can't find them anywhere else. Even if I look for them via Spotlight I don't find them anymore. Does any

  • Erro when lookup Rmi Server.. URGENT

    Hey everybody, I tryed a lot to find wich is the problem... Everytime i do that:: m_urlRmi = "rmi://host/"; obj = "objImpl"; m_objeto = java.rmi.Naming.lookup(m_urlRmi + obj); <<<< it gives me an error::: java.rmi.UnmarshalException: Error unmarshali

  • Odd display problems

    I run two 19" CRT monitors off my G4 QS...have for years with no problems. This morning, I arrived in my office, computer running with both monitors displaying fine, and, without touching anything, the left one went dark. I thought I might have jostl