Results 1 to 3 of 3
  1. #1
    Deepika04 is offline Member
    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Default applet code to open a document

    /* <applet code="showDemo" height=300 width=300> </applet> */

    import java.awt.*;
    import java.applet.*;
    import java.net.*;

    @SuppressWarnings("serial")
    public class ShowDemo extends Applet
    {
    public void start() {
    AppletContext ac = getAppletContext();
    URL url = getCodeBase();

    try{
    ac.showDocument(new URL(url + "F:/Work_deepika/JavaVsAndroid.doc"));
    }catch(MalformedURLException e){
    showStatus("URL not Found ");
    }
    }

    plz tell me corrections to properly view a document in applet

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: applet code to open a document

    Moved out of staff only section.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: applet code to open a document

    What happens when you compile and execute the code?

    Please edit your post and wrap your code with code tags:
    [code]
    YOUR CODE HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 0
    Last Post: 10-17-2011, 05:48 PM
  2. Replies: 1
    Last Post: 08-14-2011, 03:07 AM
  3. open text document using JButton
    By coopc in forum New To Java
    Replies: 3
    Last Post: 05-04-2011, 12:02 AM
  4. i want to open a document from my program
    By akinpam in forum New To Java
    Replies: 1
    Last Post: 12-21-2008, 06:09 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •