Using applets

I have a web application that contains a servlet, applet, jsps, html, etc. The applet classes are
packaged in a jar file in the <web app root>/classes directory. On the root, I have an html page
that is supposed to access the applet. Any time I go to this page, the applet classes cannot be
found. I'm using the same web app on a different application server, and everything works fine. Has
anyone been able to use applets with WebLogic?
Here is my html code for displaying the applet...
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 100% HEIGHT = 100%
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME=CODE VALUE = "com.mxi.mx.expeditor.applet.ExpeditorApplet" >
<PARAM NAME=ARCHIVE VALUE = "ExpeditorApplet.jar" >
<PARAM NAME="codebase" VALUE = "classes/" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
</OBJECT>
</BODY>
Josh Cimino
Software Developer
Mxi Technologies Ltd.
1430 Blair Place, Suite 800
Ottawa, ON, Canada
K1J 9N2
E: [email protected]
T: 613.747.4698 ext 479
F: 613.747.1909
www.mxi.com
"From the flight line to the bottom line"
[att1.html]

I hope I'm making at least some sense here. The classes extending Applet are to be shown in a web browser, embedded on the page. A class with nothing but a main-method would traditionally be a command-line application. Extending Frame results in a stand-alone application with a visible window, a GUI. They are all correct, it just depends on what you want to create.

Similar Messages

  • Using applet to select a part of an image and then save it

    Hi ,
    I want to use applet to select a part of an image and then save that particular selected part to a server. can anyone provide me a code for this. I have found codes on the sun site which help in uploading an image but I am having trouble in trying to select a part of the image.

    Sorry to get back to you so late, but I was away from my computer this afternoon.
    I'm not sure just what you are after. I do see that you have positioned the tree on the labels. I went to the web site for the label company, and their instructions are not too helplful.
    http://www.pixentral.com/show.php?picture=15sBkl9OZE9xSkHoLMxgwjTFv2VCg1
    I changed the white portion of 1 label to black - - this can be any color. To do this use the magic wand tool, tolerance=10 worked for me, then go to Edit>fill selection.

  • Print string to client printer using applet

    How to print a string directly to the client printer after clicking a button from my jsp/html page?
    I have posted a similar question here and someone(pqeuens) advised to use applet. I have been reading about applet & created one.
    I tried running it as a Java application & it prints as expected. However when i put it inside a jsp/html page, it will not print.
    Can anyone help me out on this? Perhaps share a code. That will be very much appreciated...
    Thank you

    I said you couldnt just print from JSP but you might be when you use a SIGNED applet.
    But then you need to move to the java applet forum and ask question there.
    Furthermore a standard applet cannot print because of the security invloved in applets. Nor will you be allowed to write files onto the client.

  • How can I use applet to get the desktop image of client

    hi,I have a question to ask u.
    How can I use applet to get the desktop image of client? Now I develop a web application and want user in the client to get his current image of the screen.And then save as a picture of jpeg format ,then upload it to the server?
    I have done an application to get the screen image and do upload file to server in a servlet with the http protocal.

    Since the desktop image is on the client's local hard drive, you'll need to look at trusted applets first.

  • Error while running PING program using applet. Pls correct the code.-urgent

    Can anyone pls correct the error in the below code.
    Program : TestExec1
    Using : Applet
    Logic : Trying to display the ping status in the text area but it returns error...!
    CODING
    import java.awt.*;
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.*;
    /*<applet code="TestExec1" width=380 height=150>
    </applet>
    public class TestExec1 extends Applet
    String line = null;
    TextArea outputArea;
    Process p;     
         public void init()
              outputArea = new TextArea(20,20);
         public void start()
              try
                        Process p= Runtime.getRuntime().exec("ping 192.168.100.192 -t");
                        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                        while ((line = in.readLine()) != null)
                             outputArea.append("\n" + line);
                             System.out.println(line);
              catch (IOException e)
                        e.printStackTrace();
    Error : C:\Program Files\Java\jdk1.6.0_02\bin>appletviewer TestExec1.java
    java.security.AccessControlException: access denied (java.io.FilePermission <<AL
    L FILES>> execute)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:323)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkExec(SecurityManager.java:782)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:447)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at TestExec1.start(TestExec1.java:31)
    at sun.applet.AppletPanel.run(AppletPanel.java:458)
    at java.lang.Thread.run(Thread.java:619)
    Regards
    ESM

    java.security.AccessControlException: access denied (java.io.FilePermission
    <<ALL FILES>> execute)This message tells you that the applet does not have permission to access/execute files. Access may be granted by either signing the applet, which allows the user to grant (or not grant) the access when running the applet, or by adding the necessary permission file to the user's computer.
    See http://java.sun.com/javase/6/docs/technotes/guides/security/index.html

  • Java graphics app prob regarding painting........ app does NOT use applets

    Hi ,
    I basically want to write a java graphics game application ......At this point in time all I want to do is add a green rectangle to the content pane.......I can do this but I want to stick with OO concepts so I have various classes......the thing is ....when a user resizes the window the graphic I have painted dissapeared
    I will show the classes I have used and the code below......I want to do the program conforming to the way I was tought java which is to have a main controlling class that orchestrates communication between unrelated classes and their methods. In addition to my question if anyone sees stuff fundementally wrong with my code and has a better solution please feel free to enlighten me :-)
    main controlling class:
    import java.awt.Graphics;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2005</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class PoolApp {
    public PoolApp() {
    //creates new gamescreen object
    GameScreen aScreen = new GameScreen(this);
    public static void main(String[] args) {
    PoolApp poolApp1 = new PoolApp();
    public Graphics getPaintedTable(GameScreen aGameScreen) {
    Paint aPaint = new Paint(this);
    Graphics tblObj = aPaint.getTbleGraphic(aGameScreen);
    return tblObj;
    ------end main controlling class
    ------TLayer Class start
    import javax.swing.*;
    /* The purpose of this class was to create a generic frame that would
    be inherited from all screen classes ...I initially had this creating a black background that would be inherited from child classes but that created
    more problems when the screen was resized by one of the child classes*/
    public class TLayer extends JFrame {
    public TLayer() {
    -----TLayer Class end
    -----GameScreen class start--------
    public class GameScreen extends TLayer{
    private PoolApp thePoolApp;
    public GameScreen(PoolApp aPoolApp) {
    thePoolApp = aPoolApp; //set a reference from here to the controlling PoolApp initGameScreen(); //initialise and show GameScreen .....screen
    public void initGameScreen() {
    this.setSize(800,600);
    this.show();
    //now make a request to the poolapp controlling class to ask for a painted green table and get the paint class to paint it to screen
    thePoolApp.getPaintedTable(this);
    ----GameScreen class end------------
    ----PaintScreen class start-------------
    PoolApp thePoolApp;
    public Paint() {
    public Paint(PoolApp apoolApp) {
    thePoolApp = apoolApp;
    public Graphics getTbleGraphic(GameScreen aGameScreen) {
    Container theCont = aGameScreen.getContentPane(); //assign the gamescreen content pane to a container
    theCont.setSize(200,200); //set a viewable size to the container
    Graphics thetbl = theCont.getGraphics(); //get container graphics context and assign it to a graphics object
    thetbl.setColor(Color.green); //color the object
    thetbl.fillRect(30,30,20,60); //fill the rectangle
    return thetbl; //return the object
    ---PaintScreen class end---------------
    This code actually draws the green rectangle to the gamescreen from the paint class .......so it works to a degree! ......whenever I resize the window the painted image dissapears, could anyone suggest a way around this also ...am I going about this the correct way? Im open to making mass changes to better the program ......the only thing I do not want is to use applets! .....as I want to learn the fundementals of custom painting my stuff
    Any help is much needed and appreciated
    David

    Hi .....I managed to fix my problem .....but I have really had to get my head around method overiding! ......Your advice is taken onboard ...also Im going to try and find a straight forward diagram of the java graphics heirrachy ......well the parts that are reasnable to what Im doing ......Also from what I know and what you have said yes threads would definately be the way to go as far as animation and paintings concerned...I plan to do some serious research on that as I progress.
    I am going to post my basic working program ........I was wandering if you think this is an effiecent way I have done this? or if you could make any recommendations? its just I dont want to adopt this approach and find its no good when I get further into the programs development :-)) anyway heres the code :
    ------Class PoolApp start--------------
    public class PoolApp {
      public PoolApp() {
        GameScreen aGScreen = new GameScreen(this);
      public static void main(String[] args) {
        PoolApp poolApp1 = new PoolApp();
    }------Class PoolApp end--------------
    ------Class TLayer start--------------
    import javax.swing.*;
    import java.awt.Graphics;
    public class TLayer extends JFrame {
      public TLayer() {
         System.out.println("In TLayer default constructor");
         this.setSize(800,600);
    }------Class TLayer end--------------
    ------Class GameScreen start--------------
    import java.awt.Graphics;
    public class GameScreen extends TLayer {
      PoolApp thepoolApp;
      Table theTable;
      Graphics g;
      public GameScreen() {
       System.out.println("In gamescreen default constructor table");
      public GameScreen(PoolApp apoolApp) {
      thepoolApp = apoolApp;
      System.out.println("In gamescreen  constructor 2");
      addTable();
    public void addTable() {
    System.out.println("in addTable");
    this.show();
    //theTable = new Draw(this);
    //theTable.setTable();
    //theTable.paint(g);
    public void paint(Graphics g) {
         System.out.println("In Gamescreen paint ");
         theTable = new Table(this);
         theTable.paint(g);
    public void update(Graphics g) {
        System.out.println("In Gamescreen update ");
        theTable = new Table(this);
        theTable.paint(g);
    }------Class GameScreen end--------------
    ------Class Table start--------------
    import java.awt.Graphics;
    import java.awt.Container;
    import java.awt.Color;
    public class Table extends TLayer{
      GameScreen thegameScreen;
      public Table() {
          System.out.println("In Table default constructor");
      public Table(GameScreen agameScreen) {
        thegameScreen = agameScreen;
        System.out.println("In Table 2nd constructor");
      public void paint(Graphics theGraphic) {
        System.out.println("In Table paint ");
        Container tablecont = thegameScreen.getContentPane();
        theGraphic = tablecont.getGraphics();
        theGraphic.setColor(Color.green);
        theGraphic.fillRect(310,220,180,80);
      public void update(Graphics theGraphic) {
           System.out.println("In Table update");
       paint(theGraphic);
    }------Class Table end--------------
    To be honest I would rather have created a table object then added it to the content pane ....but when i did it that way ......and I resized the screen the green table graphic dissapeared .....I would also have prefered all painting of the table to be done in the table class but I had the same problem of the graphic dissapearing when the window was resized and this is the best solution I have come up with as yet ....:-) .....any recommendations are greatly appreciated
    Thanks
    David

  • Accessing a File within a zip, which was archived using Applet Tag

    Hi,
    Could Any one please tell me, How to Access a File from within an Applet. The File resides inside a zip which was Archived using <Applet> Tag.
    Actually, I want to write an application which runs both online and offline. So I have chosen Applet and All the files Which I need are zipped and is Archived through <Applet ARCHIVE="example.zip">.
    Now I want to access those XML files which are inside example.zip from my Applet.
    How can I do that?
    I think I will get security Exception.
    How to get rid of this security Exception.
    Kindly Answer soon.......
    It's very urgent.
    Thanking you,
    KumudaRaj

    Did you already try signing a jarfile? If no ->>
    You can call a class inside a jar-file within the applet.
    if this class should be able to acces files the jarfile
    first has to be signed. to do this, you must generate a key.
    the complete work:
    1. write your applet
    2. write a html-page with following code:
    <APPLET code="guestbook.class" archive="guestbook.jar" width=600 height=400></APPLET>
    3. make a zip-file with the guestbook.class, guestbook.form, guestbook$1.class, guestbook$... and rename it to guestbook.jar
    4. in the console type:
    keytool -genkey -alias YOURNAME
    5. sign the key to your jarfile with:
    jarsigner guestbook.jar YOURNAME
    6. try the applet. a warning should appear which you have to answer
    with YES then it should work
    my trouble is that i cant acces files anyway because right now i don�t
    alreadv have the clue to get the right (absolute?) path for the file. means i get an ioexception because the applet cant find the file :-((
    does anyone know how to solve this problem then? my code is:
    FileReader Stream = new FileReader("/members/Ui97u8g4f6b89mj90kh5gbr4ecf6KXC4/guestbook.txt");
    ...

  • Problem in connect database using applet

    hi
    please
    i want open database in page html with use Applet
    i use this code but database not work in the my page
    if this code have problem
    please correct this code to open database in page html
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(
    "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
    sta = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    res = sta.executeQuery("select * from aha");
    this is my code
    package orcle;
    import java.sql.*;
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    <applet code="test.class" width=200 height=200>
    </applet>
    public class Applora extends Applet implements ActionListener
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    String str=null;
    TextArea ta;
    public void init()
    ta= new TextArea(10,30);
    add(ta);
    Button b1 = new Button(">>");
    add(b1);
    b1.addActionListener(this);
    ta.setText("Initialization...\n");
    public void start() {java.applet.AudioClip a=  Applet.newAudioClip(Applora.class.getResource("a.mid"));
       a.play();
    public void actionPerformed(ActionEvent ae)
    ta.appendText("Inside actionPerformed\n");
    try
    ta.appendText("Inside try block\n");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    ta.appendText("Class loaded\n");
    /********** upto this point it works fine **************/
    con=DriverManager.getConnection("jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
    ta.appendText("Connection created\n");
    stmt=con.createStatement();
    ta.appendText("Statement created\n");
    rs=stmt.executeQuery("select * from aha");
    ta.appendText("Resultset created\n");
    while(rs.next())
    str=str+rs.getString(2)+" "+"\n";
    //str=str+rs.getString(2)+" "+"\n";
    ta.appendText(str);
    con.close();
    stmt.close();
    rs.close();
    }catch(ClassNotFoundException cnfe){System.out.println("Class Not found "+cnfe.getMessage());}
    catch(SQLException sqle){System.out.println("SQL Exception "+sqle.getMessage());ta.setText(sqle.getMessage());}
    catch(Exception e){ta.setText(e.getMessage());e.getMessage();}
    }

    i want access to database in page html with use AppletFirst of all, that doesn't make any sence, if it's a single user application make it a java
    application.
    If it's a multu user application make it a client server where the web server connects to
    the database when the client requests a connection.
    When the applet connects to the database any client running the applet needs a
    connection to your database server, the client needs the jdbc drivers and the client's
    jre needs to find them (set classpath with runtime parameters or set the classes in
    javadir lib). After that the client needs to change thiere java.policy or you need to sign
    the applet.
    Needless to say that's a lot of trouble. And if you go through all that trouble the client
    can de-compile your applet and see the connection to the database server and the
    server name. Now the client can destroy your database or worse see date it is not
    supposed to see.
    Since you are a brainless ... who needed to post this question 6 times did not respond to any of my post in your other threads I can just say good luck with your problem.

  • Problem in connecting remote server using Applet?

    Hello everybody,
    I am facing problem in connecting to remote server using Applet in browser. I am using JDK 1.5.0_12 and running the application on apache 2.2.
    Firstly I have tried with simple jar file which could not connect to remote server and throws permission denied than now I am trying with signed jar file but also not working. I have changed the java.policy file of JDK in server with grant all Permission but also it throws "java.security.AccessControlException:access denied(java.net.SocketPermission 127.0.0.1:1521 connect, resolve)".
    Can anybody suggest me how to solve this problem?
    Thank You.
    -Ritesh

    >
    I am facing problem in connecting to remote server using Applet in browser.
    Firstly I have tried with simple jar file which could not connect to remote server and throws permission denied than now I am trying with signed jar file but also not working. >Were you prompted to accept the digitally signed code? To see what I mean, check out the [Defensive loading of trusted applets demo|http://pscode.org/test/docload/]. If you are not getting the prompt, or refused it, follow the link to sandbox.html for tips on how to proceed.

  • How to retrieve system Information on client machine Using Applets

    How to retrieve video card information on client machine using applets and JNI, please suggest me on this
    Thanks
    GReddy

    1. Research platform specific OS API to do whatever you want with video cards
    2. Write C/C++ code to wrap the functionality in 1 into something looks closer to what you want to see in java
    3. Write a class that models the functionality of 2 with native methods.
    4. Write the native methods of 3 such that they call the methods of 2.
    Note that steps 1 and 2 have NOTHING to do with jni nor java. So you start by looking somewhere else for the answers to that.

  • Help!!! Upload Files using Applet.

    I've built an upload application using html tag <input type="file" ...>. Both client and server's programs have been finished for a long time. However, my boss want to use applet replace html tag(due to some reasons). I want to build an applet which allow user to select multiple files and then upload. But I don't want to modify the server side program. May anyone teach me on how to upload the files which generate the page which is the same as the HTTP request? Thanks a lot.

    No. You could sign the applet for granting the permission. Could anyone tell me how to generate the http request with contents and file inside?

  • Using Applets in ADF Web Application

    Hi,
    I'm building an ADF web application using JDeveloper 11. I would have to use applets which have to "communicate" with database (insert, update).
    What would be considered as "the best practice" for that "JDBC flavored applet"? Is it possible to reuse a database connection?
    Any suggestion would be appreciated.
    Thanks.

    Boris,
    You could still use ADF Business Components and access them remotely (from the applet).
    John

  • Applet - error in simple Ping program using Applet.Pls correct my error.

    Can anyone pls correct the error in the below code.
    Program : TestExec1
    Using : Applet
    Logic : Trying to display the continous pinging status in the textarea in applet, but it returns error...!
    CODING
    import java.awt.*;
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.*;
    /*<applet code="TestExec1" width=380 height=150>
    </applet>
    public class TestExec1 extends Applet
    String line = null;
    TextArea outputArea;
    Process p;
    public void init()
    outputArea = new TextArea(20,20);
    public void start()
    try
    Process p= Runtime.getRuntime().exec("ping 192.168.100.192 -t");BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((line = in.readLine()) != null)
    outputArea.append("\n" + line);
    System.out.println(line);
    catch (IOException e)
    e.printStackTrace();
    Error : C:\Program Files\Java\jdk1.6.0_02\bin>appletviewer TestExec1.java
    java.security.AccessControlException: access denied (java.io.FilePermission <<AL
    L FILES>> execute)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:323)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkExec(SecurityManager.java:782)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:447)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at TestExec1.start(TestExec1.java:31)
    at sun.applet.AppletPanel.run(AppletPanel.java:458)
    at java.lang.Thread.run(Thread.java:619)
    Regards
    ESM

    Will you please tell the procedure of how to use jarsigner and make a sign in for my program.
    class Name : SamplePing.java
    Using : Applet
    Manifest file : manifest.txt
    Main Class : SamplePing
    I have created jar file using the following command -
    "jar cvfm Ping.jar manifest.txt Sa*.class "
    Let me know how can i proceed further to run exec command in applet.Pls give me series of steps.
    Thanks in advance.

  • Upload http file using applet

    Hello every body,
    I am trying to upload the http file using applet. Can any body give me the hint or example.
    Thanks in advance
    best regards

    any of several libraries are out there that would let you to HTTP File Upload to a web server, assuming the web server has a servlet or other thing to accept the file.
    Of course, where you get the file might be a problem without a signed applet.

  • How to access a file using Applet?

    Dear all,
    I would like to use an applet to read and display information on server side, but there still a fileaccess permission denied, what can i do?
    The idea of the web service is like that::
    1.User connected to a webpage, than they can choose the file and then,
    2. the file name will be transfered into the applet (using applet><param> tags etc.)
    3. THe applet read and displays information.
    In addition, the file is placed at server side, should I set the "./hotjava/ properties "

    Maybe you should sign your applet.
    You'll find further information in the Signed Applets Forum:
    http://forum.java.sun.com/forum.jspa?forumID=63

  • Can i load a class in subdirectoy  inside a jar file using applet tag?

    hi every one.. thank you for reading ... i am really in dire need for the solution..
    my problem is that i have a jar file contianing a package which inturn contains my applet class...
    i am trying to access this applet class using a applet tag in html file. this html file is in same directory as the jar file. i am having no problems in windows but when i am doing this in linux apache server i was getting class not found exception. (already checked the file permissions). and when i am successful when using simple package directory instead of jar file . so gist of my quesition is "can i load a class in subdirectoy inside a jar file using applet tag in a html file"?

    When you tested in Windows were you using Internet Explorer? On Linux you will be using a different browser, usually Mozilla of some version, or Firefox. Note that the HTML tags for applets will be different between the browsers if you are using the object tag. Principally the classid value for the object tag will differ between Firefox and Internet Explorer.

Maybe you are looking for