Help me please need help on my java applet

hi there i have started a final year project on java.
it is a simple drawing applet however i need to be able to
save my drawings to a local hard disk. i have tried going through the tutorial but i dnt get it. please can any1 out there help me. my email address is [email protected] if you give me your email address i will mail you my program and maybe you could help me
Aj

If you want an applet to write to user's local hard drive, there are many securiy issues that need to be resolved. How to resolve these issues depend on whether the applet uses a plugin (swing) or the browser's native JVM (no plugin, uses AWT only). In any event, the applet will probably need to be signed and the user's browser must be correctly configured. The following link gives you some detail on how to sign an applet that doesn't use swing:
http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm
The instructions on the first two links should point you to the right direction...
V.V.

Similar Messages

  • Can anyone help with the java applet issue

    Hello everyone,
    This is my first thread in this forum,
    I need a little help with the form developer...
    I have oracle 9i db , 9i form developer
    I don't want to run the form i created as a java applet
    HOW IS THAT DONE i.e NOT IN THE INTERNET EXPLORER?????????
    ***IF ITS POSSIBLE

    Hello,
    I don't want to run the form i created as a java applet
    No chance, because the Web Forms client is an applet and cannot be anything else.
    Francois

  • Need help with a Java applet

    newGame.setActionCommand("newgame:1");
    newGame2.setActionCommand("newgame:2");
    //other lines of code in a previous method, rest of code not shown
    public void actionPerformed(ActionEvent evnt)
    int i;
    int j;
    String sp = new String(":");
    String[] cmd = evnt.getActionCommand().split(sp);
    // rest of code not shown
    // **When I get to that lastline, it tells me that the split() method could not be found in class String.  If you would like to see the rest of my code in order to help me, I will post anything to figure out what this problem is.*//

    "because(sic)" was supposed to be "became" ... anyway, in the API doco, when it says that something is "since 1.4", for example, it means from that point onward. So 1.5.x is good - but I wanted to warn you off v.1.3.x in case that was where you were running this.

  • Help with a simple Applet

    I am just starting Applets. This code compiles and a blank Applet displays but the Button object does not display. The HTML should be good because the blank Applet displays. Both files are saved in the same directory and my java code is compiled. Help?
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class WhosGreat extends Applet implements ActionListener
    Button btnGreat = new Button("Who's the Greatest?");
    Font LargeFnt = new Font("Times Roman",Font.BOLD,10);
    public void init()
    //btnGreat.setFont(LargeFnt);
    add(btnGreat);
    btnGreat.addActionListener(this);
    public void actionPerformed(ActionEvent e)
    String name = "Bugs Bunny";
    Label lblName = new Label("");
    lblName.setFont(LargeFnt);
    lblName.setText(name);
    add(lblName);
    invalidate();
    validate();
    }

    I compiled your code and ran it. It did just what you said in Internet explorer but it worked just fine in Netscape7 and appletviewer.Just remember microsoft sucks:)

  • Embedding Java Applet in Oracle Form

    I'd like to embed Java applet in Oracle Form. Please someone help me..let me know how to do it. Also I need to know how'll I use a jar within Oracle. Please help.
    Regards
    Rashed

    Hi Grant
    Thanks...I developed an applet which has a button on it and clicking the button something will happen. I mean this is a complete java project. Now I need to use this java applet from Oracle Form...that means I'll develop an oracle form on which the applet will be embedded so that the button on the applet can be pressed. Now could you please help me do this? I also have another problem but I need to resolve this first.
    Rashed

  • Java Applet (Masking/Scrollbar)

    hi ppl out there.. i've some difficulties in my project.. can u all help me?
    i need to create a java applet, with a scrollbar.. <-- this i know..
    but how to create a image overlapping an image? what i mean here is that i have a image (A) appearing now.. i need to have another image(B) to be on top of it.. den when i click/drag the scrollbar, the image(B) will move alittle, showing abit of image(A).. it is like masking type.. can some kind soul share with me the source code??

    i need to create a java applet, with a scrollbar.. <-- this i know..Why not use a JSlider?
    i have a image (A) appearing now.. i need to have another image(B) to be on top of it.. You can add a JPanel to your JApplet's content pane. You'll need to create your own class that extends JPanel. By creating your own class, you can override the paintComponent() method, which is where drawing on a component takes place. paintComponent() is called automatically when the component is first displayed, and when you call repaint() on the component. You can create the JPanel and add it to your JApplet inside init().
    Inside paintComponent(), you can draw the second image on top of the first image doing this:
    public void paintComponent(Graphics g)
         super.paintComponent(g);
         g.drawImage(img1, 0, 0, this); //first image
         g.drawImage(img2, 0, 0, this); //second image
    }img1 and img2 must be objects of type Image. In a JApplet, you can create Image objects from a file name like this:
    URL pic1 = new URL(getCodeBase(), "yourPic.jpg"); //.jpg file is in same directory as applet's .class file
    Image img1 = getImage(pic1);
    but how to create a image overlapping an image?If you want to move the second image over 10 pixels so that the two images are overlapping, you can do this:
    g.drawImage(img2, 10, 0, this); //x coordinate was changed from 0 to 10
    den when i click/drag the scrollbar, the image(B) will move alittle, showing abit of image(A)..You can also add a JSlider to your JApplet. A JSlider will fire a ChangeEvent event when it is moved. You can register your JPanel to listen for that event. Once your JPanel is registered for that event, the JSlider will call a stateChanged() method inside your JPanel class, which you can define to perform the tasks you want.
    If you add a member variable to your JPanel class, like
    int img2x;  //x coordinate of 2nd imageYou can read that value inside the JPanel's paintComponent() method:
    g.drawImage(img2, img2x, 0, this); //x coordinate was changed from 0 to 10If you set img2x to 0 in the JPanel's constructor, then when your JPanel is first displayed, the second image will be on top of the first image. When the user moves the slider, the stateChanged() method that you define in your JPanel class will be called. Inside stateChanged(), you can get the value of the slider; and then set img2x to that value; and then call repaint() on your JPanel. Calling repaint() on your JPanel will cause paintComponent() to be called, which will read the new value for img2x, which will cause the second image to move to the new coordinates and reveal part of the first image.
    See here for more information on how to use a JSlider:
    http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html

  • Embedded Java Applet NullPointerException in JSPX pages

    We have a ADF web application programmed in JDeveloper 11g (11.1.2.4.0), which was migrated over from a 10g (10.1.3.5.0) project
    Within the application, occasionally, we need to call a Java Applet which is placed in a public_html/applet folder. The jars show up in the Web-Content tab of the ViewController in the Application Navigator, just like it did in 10g.
    The applet tag looks like this:
    <applet height="100" width="100" code="applet.SetupApplet" archive="applet/SSetupApplet.jar">
                <param name="debug" value="true"/>   
    </applet>
    I've also tried calling the applet with the Java deploy applet script
    <trh:script source="http://java.com/js/deployJava.js"></trh:script>
        <trh:script>
            var attributes = {code:'applet.SetupApplet',
            archive:'applet/SSetupApplet.jar'};
            var parameters = {} ;
            var version = '1.6' ;
            deployJava.runApplet(attributes, parameters, version);
       </trh:script>
    When I navigate to the login.jspx page that has this tag, it pops the Java Console open, but doesn't actually run the applet (or show the prompts to allow using the Applet). Instead, the applet is shown with an error and the error says "NullPointerException". I've double-checked the path and it's correct (with incorrect paths, I get a ClassNotFoundException). In the application server logs, I see the following error:
    <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on IPADDRESS during the configured idle timeout of 5 secs>
    I created a normal .jsp file that's outside the ADF Faces Context in the applet folder. Navigating to it with the same applet tags does have the Java applet run without the socket error. The same code in 10g works fine.
    Is there anything I'm missing?
    Thanks.

    Hi,
    this is how I did it in 11g R1: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf
    Frank

  • My Upgrading Java Applets Cache won't finish

    I had to reinstall Java 6.0 and each time I try to run something requiring Java, it doesn't load. All I get is a box stating Upgrading Java Applets Chache, it runs about half way and then quits. I am getting very frustrated after working on this for 2 days.
    It says "Please wait while your stored Java Applets are updated for Java SE 6". Runs for about 20 secs and then stops and the box disappears. Does anybody have any suggestions? I am not very computer savvy so please explain in simple terms.
    Thanks

    Hi
    I had the exact same problem. took me days to find the solution, hope it works for you.
    Click on the START button bottom left on the screen, Then look for the CONTROL PANEL button and click, (this should bring up lots of icons for programmes) on some computers its under themes and sttings I think. Click on the JAVA icon this brings up a CONTROL PANEL. Click on SETTINGS at the bottom, then click DELETE FILES. (this took a while to complete on my computer) Just to make sure after you've done this bring up the JAVA CONTROL PANEL again but this time click on ADVANCED. Then at the bottom theres is Miscellaneous, click on this and there should be JAVA QUICK STARTER with a box ticked next to it, Click on the tick and get rid of it then click on OK..
    Try a website that uses Java. the cache box might appear again but just hit cancel. When I tried this i was able to use Java again.
    Hope it works

  • Tools and sdk to make java applet for JCOP31 ?

    Dear friend,
    we have a contactless chip card with NXP contactless chip 36 Kb and 72 Kb...
    it has JCOP31 (java card open platform) inside the contactless chip..
    and we have to build the java applet to be inserted into the JCOP31 chip ...
    my questions :
    ========
    1. can we use eclipse to make java applet for this purpose ?
    2. what other tools and SDK do we need to make this Java applet and insert it into the
    JCOP31 chip ?
    3. How can we get the tools ? do you provide it ?
    4. do you know any company that can make this type of java applet for JCOP 31 ?
    5. do you know any company that provide training to make this java applet for jcop31 ?
    Thank you,
    Hendy
    IT Manager
    PT. Jaya Smart Technology
    Jalan Kapuk Kamal No. 45
    Jakarta
    Mobile : 62 815 840 528 63

    4. Anyone can write you an applet. The specification is open. You could e.g. contact IBM or NXP directly.
    5. NXP offers twice a year a training in Europe and once a yeat in Asia. Contact the customer support at NXP. Also there is a workshop about the 'Art of Java Card Programming' at the smart-university.net (17th Sept., Sophia Antipolis, France). But I think this is for advanced Java Card programmers.

  • I need some help with my java game using applets, CAN SOMEBODY PLEASE HELP

    Hi,
    I am in the process of creating a RPG program using Java. I am not very experienced with java, however the problem i am currently facing is something i can't seem to figure out. I would like to draw a simple grid where a character (indicated by a filled circle) moves around this grid collecting items (indicated by a red rectangle). When the character moves on top of the grid with the item, i would like it to disappear. Right now i am not worrying about the fact that the item will reappear after the character moves away again, because sometimes, when the character moves over the item, nothing happens/another item disappears. i have been at this for 4 days and still cannot figure out what is goign on. can somebody please help me? it would be most appreciated.
    Thanks
    PS if i needed to send you my code, how do i do it?

    Thank you for replying.
    The thing is, I am taking java as a course, and it is necessary for me to start off this way (this is for my summative evaluation). i agree with you on the fact, however, that i should go in small steps. i have been doing that until this point, and my frustration caused me to jump around randomly for an answer. I also think that it may just be a bug, but i have no clue as to how to fix it, as i need to show my teacher at least a part of what i was doing by sometime next week. Here is my code for anybody willing to go through it:
    // The "Keys3" class.
    import java.applet.*;
    import java.awt.*;
    import java.awt.Event;
    import java.awt.Font;
    import java.awt.Color;
    import java.applet.AudioClip;
    public class Keys3 extends java.applet.Applet
        char currkey;
        int currx, curry, yint, xint;
        int itmval [] = new int [5],
            locval [] = new int [5],
            tempx [] = new int [5], tempy [] = new int [5],
            tot = 0, score = 0;
        boolean check = true;
        AudioClip bgSound, bgSound2;
        AudioClip hit;
        private Image offscreenImage;
        private Graphics offscreen;     //initializing variables for double buffering
        public void init ()  //DONE
            bgSound = getAudioClip (getCodeBase (), "sound2_works.au");
            hit = getAudioClip (getCodeBase (), "ah_works.au");
            if (bgSound != null)
                bgSound.loop ();
            currx = 162;
            curry = 68;
            setBackground (Color.white);
            for (int count = 0 ; count < 5 ; count++)
                itmval [count] = (int) (Math.random () * 5) + 1;
                locval [count] = (int) (Math.random () * 25) + 1;
            requestFocus ();
        public void paint (Graphics g)  //DONE
            resize (350, 270);
            drawgrid (g);
            if (check = true)
                pickitems (g);
                drawitems (g);
            g.setColor (Color.darkGray);
            g.fillOval (currx, curry, 25, 25);
            if (currkey != 0)
                g.setColor (Color.darkGray);
                g.fillOval (currx, curry, 25, 25);
            if (collcheck () != true)
                collision (g);
            else
                drawitems (g);
        } // paint method
        public void update (Graphics g)  //uses the double buffering method to overwrite the original
                                         //screen with another copy to reduce flickering
            if (offscreenImage == null)
                offscreenImage = createImage (this.getSize ().width, this.getSize ().height);
                offscreen = offscreenImage.getGraphics ();
            } //what to do if there is no offscreenImage copy of the original screen
            //draws the backgroudn colour of the offscreen
            offscreen.setColor (getBackground ());
            offscreen.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
            //draws the foreground colour of the offscreen
            offscreen.setColor (getForeground ());
            paint (offscreen);
            //draws the offscreen image onto the main screen
            g.drawImage (offscreenImage, 0, 0, this);
        public boolean keyDown (Event evt, int key)  //DONE
            switch (key)
                case Event.DOWN:
                    curry += 46;
                    if (curry >= 252)
                        curry -= 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.UP:
                    curry -= 46;
                    if (curry <= 0)
                        curry += 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.LEFT:
                    currx -= 66;
                    if (currx <= 0)
                        currx += 66;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.RIGHT:
                    currx += 66;
                    if (currx >= 360)
                        currx -= 66;
                        if (hit != null)
                            hit.play ();
                    break;
                default:
                    currkey = (char) key;
            repaint ();
            return true;
        public boolean collcheck ()  //DONE
            if (((currx == tempx [0]) && (curry == tempy [0])) || ((currx == tempx [1]) && (curry == tempy [1])) || ((currx == tempx [2]) && (curry == tempy [2])) || ((currx == tempx [3]) && (curry == tempy [3])) || ((currx == tempx [4]) && (curry == tempy [4])))
                return false;
            else
                return true;
        public void collision (Graphics g)
            drawgrid (g);
            for (int count = 0 ; count < 5 ; count++)
                if ((currx == tempx [count]) && (curry == tempy [count]))
                    g.setColor (Color.darkGray);
                    g.fillOval (currx, curry, 25, 25);
                else if ((currx != tempx [count]) && (curry != tempy [count]))
                    g.setColor (Color.red);
                    g.fillRect (tempx [count], tempy [count], 25, 25);
        public void drawitems (Graphics g)
            for (int count = 0 ; count < 5 ; count++)
                g.setColor (Color.red);
                g.fillRect (tempx [count], tempy [count], 25, 25);
        public void pickitems (Graphics g)
            check = false;
            for (int count = 0 ; count < 5 ; count++)
                if (locval [count] <= 5)
                    tempy [count] = 22;
                else if (locval [count] <= 10)
                    tempy [count] = 68;
                else if (locval [count] <= 15)
                    tempy [count] = 114;
                else if (locval [count] <= 20)
                    tempy [count] = 160;
                else if (locval [count] <= 25)
                    tempy [count] = 206; //this determines the y-position of the item to be placed
                if (locval [count] % 5 == 0)
                    tempx [count] = 294;
                else if ((locval [count] == 1) || (locval [count] == 6) || (locval [count] == 11) || (locval [count] == 16) || (locval [count] == 21))
                    tempx [count] = 30;
                else if ((locval [count] == 2) || (locval [count] == 7) || (locval [count] == 12) || (locval [count] == 17) || (locval [count] == 22))
                    tempx [count] = 96;
                else if ((locval [count] == 3) || (locval [count] == 8) || (locval [count] == 13) || (locval [count] == 18) || (locval [count] == 23))
                    tempx [count] = 162;
                else if ((locval [count] == 4) || (locval [count] == 9) || (locval [count] == 14) || (locval [count] == 19) || (locval [count] == 24))
                    tempx [count] = 228;
        public void drawgrid (Graphics g)  //DONE
            g.drawRect (10, 10, 330, 230); //draws the outer rectangular border
            int wi = 10; //width of one square on the board
            int hi = 10; //height of one square on the board
            for (int height = 1 ; height <= 5 ; height++)
                for (int row = 1 ; row <= 5 ; row++)
                    if (((height % 2 == 1) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))
                        g.setColor (Color.gray);
                        g.fillRect (wi, hi, 66, 46);
                    else /*if (((height % 2 == 0) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))*/
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46);
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46); //drawn twice to make a shadow effect
                    wi += 66;
                wi = 10;
                hi += 46;
            } //this draws the basic outline of the game screen
    } // Keys3 class

  • To open "Java Preferences," you need to install a Java runtime, but you are not connected to the Internet. I have tried links that people have put on other discussions but all i get is a black screen please help!!

    To open “Java Preferences,” you need to install a Java runtime, but you are not connected to the Internet. I have tried links that people have put on other discussions but all i get is a black screen please help!!

    Try this link, warning, it's straight to download mode:
    http://support.apple.com/downloads/DL1421/en_US/JavaForMacOSX10.7.dmg

  • URGETN HELP NEEDED! JAVA APPLET READING FILE

    Hi everyone
    I need to hand in this assignment today
    Im trying to read from a file and read it onto the screen, my code keeps showing up an error
    'missing method body, or declare abstract'
    This is coming up for the
    public statuc void main(String[] args);
    and the
    public void init();
    Here is my code:
    import java.io.*;
    import java.awt.*;
    import java.applet.*;
    public class Empty_3 extends Applet {
    TextArea ta = new TextArea();
    public static void main(String[] args);
    public void init();
    setLayout(new BorderLayout());
    add(ta, BorderLayout.CENTER);
    try {
    InputStream in =
    getClass().getResourceAsStream("test1.txt");
    InputStreamReader isr =
    new InputStreamReader(in);
    BufferedReader br =
    new BufferedReader(isr);
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    String line;
    while ((line = br.readLine()) != null) {
    pw.println(line);
    ta.setText(sw.toString());
    } catch (IOException io) {
    ta.setText("Ooops");
    Can anyone help me please?
    Is this the best way of doing this? Once i read the file i want to perform a frequency analysis on the words so if there is a better method for this then please let me know!
    Thankyou
    Matt

    Whether it is urgent or not, does not interest us. It might be urgent for you but for nobody else.
    Writing all-capitals is considered shouting and rude.
    // Use code tags for source.

  • Need help for downloading java at mac book retina

    i want to download java at my mac book pro retina but everytime we downloaded its not working..i need this because im going to use it to open my bank account...everytime i gonna check my bank account i need to use another computer not this my mac.why?? can you help me please.

    Banks do NOT use Java-in-a-Browser for anything, at all. If you have received a suggestion to conduct banking with JAVA enabled in your Browser, someone is attempting to commit a crime, with you as the intended victim.  You are being scammed and should report it to the Police.

  • Need help! Vrml&Java&Java3D

    I want to control a Vrml Model through Java applet or Java 3D,I try some methods,but none of them work well.
    I edited my source code in UltraEdit,and compiled it under command line,in my classpath,I had added the vrml97.jar,so I compiled it successful,but when I run it,it cause a exception"NoClassDefException",what should I do?
    So I changed my method,I used another "jar" file provided by cosmoplayer,a Vrml Browser,to control my model,as example in the web,I complied it successful,but when I run it through IE,it still cause some exceptions,even when I try the example provided by cosmoplayer itself,it also give me some wrong information just like this:
    Loading Script Node class http://foo.co.jp/Example1.class
    # Could not load the script class http://foo.co.jp/Example1.class.
    # Please make sure the class is declared PUBLIC or the class file exists.
    but this class file is on that path properly! I was puzzled
    with this for a long time.by the way,all the document in the web only write the source file like this:
    import vrml.*;but I can't found this package,so I renamed the nocosmop21.jar into vrml.jar.and put it in the classpath,but I think this is not the correct way,it must cause a lot of trouble.So if I want use the jar provided with cosmoplayer,what should I do?

    Did you install Vrml97.jar in your JRE's ext folder (so it will be used in running your applet) as well as you SDK's folder (so that it can be used in the compile)?
    Check out the link shown below where I've worked with another person who had similar problem -- while I was able to finally helped that person, it turned out that I wasn't too succesful myself simply because I was using SDK1.3.1.
    http://forum.java.sun.com/thread.jsp?forum=37&thread=231662
    The problem with using vrml in an applet is that if you need to read a .wrl file from the local disk with the vrml class loader, you run into two security violations: runtime permission to use the class loader and i/o permission to read the local disk file. The URL that I posted in the link shown above is still active and you can try to run this self-signed applet to see if it works for you.
    V.V.

  • I need to trigger my java code automatically daily once ... help me

    hi
    i am working with a java program which updates database(mySql) daily once
    i need to make my java code run daily once automatically
    how can i make it to do that
    please someone help me
    thanks in advance

    U can use, autoexec.bat file for executing u'r
    code , but problem is that it will run every time
    system will start,
    so their is a another option for scheduling, try
    at/? in command prompt it will give u enough
    detail to use it for scheduling."Scheduled Tasks" is a UI for the "at" command, and it might be a bit easier for the OP to use that.
    /Kaj

Maybe you are looking for

  • Why no SyncML-support for Harmattan??

    I've used SyncML on my N95 with memotoo.com for years. Worked very well. I took it for granted that SyncML would be supported on the N9. But alas, it isn't. I find that really incomprehensible. Worse yet, CalDAV syncing with memotoo doesn't work - I

  • Using iphoto, how do I print a written description upon an image?

    Would like my images to have descriptive text boxes. Want to be able to print descriptions at the same time, on the face of a photo without having to go into Adobe Photoshop. Using the iPhoto program, how do I print a written description upon an imag

  • Local files not playing on Windows 8

    If you've installed Windows 8 on your computer instead of the previous Windows 7, you may experience an issue where none of your local files will play. First try reinstalling Spotify, installing Quicktime, deleting all the Local files and unchecking

  • Dreamweaver CS3 to CS4 Changes

    Changes in Dreamwever CS3 to CS4 Creating a text box over a photo. I have been using a technique in CS3 learned from "totaltraining.com" I could take a photo into photoshop and slice it into areas where I want to create a text block and use the photo

  • Mininum resources for Oracle VM

    Hi, I want to know the bare minimum hardware requirement for Oracle VM setup. 1) Oracle VM server: It's mentioned in Server Installation guide that, dual core CPU and at least 1GB memory is required. Can we install oracle VM server with 512MB memory?