NIGHTMARE! Signed Applet - No Access. Please Help.

Hi:
I'm trying to make a signed applet gain access to my directory structure.
I created a simple applet to test with one line:
sErr = System.getProperty("user.dir");
The code is below.
I sign it using the following:
keytool -genkey -keyalg rsa -storepass MyCerts
As you can see I'm using the default keystore but I've tried it by using -keystore MyKeystore too.
It runs me through all the questions which I answer, no problems.
Then I sign it:
jarsigner -signedjar SSignedApplet.jar SignedApplet.jar MyCerts
It asks for the passwords which I enter.
It completes without error and the SSignedApplet.jar file shows up in the directory.
If I open the signed jar file it has all 3 of the files in the META-INF folder and the Manifest file looks right to me.
I upload the jar and the Default.asp file to a Web server (I've tried localhost and a remote host).
I open the page and the pop up comes up asking if I want to trust the unverified applet. I click 'Run'.
Once the applet is 'Started' I click the 'Get Properties' button and I get the error:
access denied (java.util.PropertyPermission user.dir read)
I've tried 2 examples that work fine on my machine (that I didn't write).
The first is by Francois Orsini (Derby Demo) and the other is by Laura MacDougal (successfully wrote a file to my user.dir directory).
No matter what I do, I can't sign an applet and make it access anything.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-US">
<head>
<script language="JavaScript" type="text/javascript">
<!--
function getProp()
     oApplet = document.SampleApplet;
     oApplet.getProp();
     alert(oApplet.sErr);
// End SCRIPT -->
</script>
</head>
<body bgcolor="#ffffff" style="margin:0px auto;width:800px;padding:0px">
<form name="fmLogin" action="" method="POST">
<table width="650" align="center" cellpadding="0" cellspacing="0">
     <tr>
          <td>Login</td>
          <td><input name="Login"></td>
     </tr>
     <tr>
          <td>Password</td>
          <td><input name="Password"></td>
     </tr>
     <tr>          
          <td colspan="2"><input type="button" onclick="getProp();" value="Get Property"></td>
     </tr>
</table>
</form>
<APPLET CODE="SignedApplet.SampleApplet.class" WIDTH=1 HEIGHT=1 NAME="SampleApplet" ARCHIVE="SSignedApplet.jar"></APPLET>
</body>
</html>
package SignedApplet;
import java.applet.*;
import java.io.*;
import java.util.*;
public class SampleApplet extends java.applet.Applet {
    public String sErr = "";
    public void init() {
        // TODO start asynchronous download of heavy resources
    public void getProp()
        try
            sErr = System.getProperty("user.dir");
        catch(Exception exp)
            sErr = exp.getMessage();
    // TODO overwrite start(), stop() and destroy() methods
}

Thank you for reading my reply in your other thread:
http://forum.java.sun.com/thread.jspa?threadID=762212&messageID=4368224#4368224
If you've really run through it you would have known that code called from
javascript is not trusted and you have to use doprivileged (hey its in bold...
why would that be?).
Call getProp from init within the applet and you've got no problem.
As for your imageIcon, creating one with string as a parameter
the string is used as input for a File. I had no problem loading one with a signed applet.
I'll post the example later in your other thread.

Similar Messages

  • My I pod touch has the logo and busy sign and is frozen please help

    My I pod touch has the logo and busy sign and is frozen please help
    Cheers Allan

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • Cloud keeps signing me out. Please help!

    I'm trying to download the Photoshop application from my cloud area but the cloud keeps signing me OUT! Please help!

    Try the answer here:
    https://forums.adobe.com/thread/1440098

  • The account is invalid to access, please help me to connect to a new right email address. This is urgent for the pre-order, please respond as soon as possible.

    My email account is invalid to access, please help me to connect to a new right email address. This is urgent for the pre-order process, please respond as soon as possible.
    <Email Edited by Host>

    This is a user-to-user technical support forum. No one here can help you.
    Try
    https://expresslane.apple.com

  • I forget passcode guided access please help?

    i forget passcode guided access please help?

    Hello alimoshkforoush,
    It sounds like you forgot the password for the Guided Access session.  Try resetting your iPhone:
    Reset
    You should reset your device as a last resort and only if you can’t restart it.
    To reset, press and hold both the Sleep.Wake and Home buttons for at least 10 seconds, until you see the Apple logo
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/HT1430
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • 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

  • FaceTime disabled access,please help

    Yesterday I was playing about with my new ipad and came across disable access so to try it out and see what it was I randomly decided to disable access to my face time and iTunes, after I done so the app icons disappeared and they are nowhere to be found, please help me get them back

    It sounds like you may have disabled them with Restrictions.
    Go to Settings > General > Restrictions and either disable Restrictions or within Restrictions, enable FaceTime and iTunes (Store?).
    ivan

  • APPLET in jsp (please help)

    hi ,
    can someone tell me please how can i load an applet dynamically in my jsp
    i have some thing like this:
    <APPLET code=" SimpleApplet.class" width=800 height=500>An Applet</APPLET>
    in this case i have allways to copy the "SimpleApplet.class" to the same directory on my jsp and the redeploy.... how can i make it dynamically??
    the "SimpleApplet.class" is in the xxx.jar of my appllication....
    please any idea??
    thanx

    First thing is the applet cannot access the classes in the WEB-INF folder so all the applet classes have to be in the webroot directory.
    Change ur build script so that it will copy it in the web root directory
    Try this
    <applet code="SimpleApplet.class" archive="SimpleApplet.jar" name="SimpleApplet"
              codebase="." width=325 height=325>
    <PARAM NAME="fileName" VALUE="test">
    <PARAM NAME="basePath" VALUE="test">
    </applet>
    Review this tutorial and you should find the problem:
    http://java.sun.com/docs/books/tutorial/deployment/applet/html.html

  • I use my apple I'd to sign into iCloud and it says - unsupported apple I'd this apple I'd cannot be used to sign into iCloud? Please help

    I use my apple I'd to sign into iCloud and it says - unsupported apple I'd this apple I'd cannot be used to sign into iCloud? Please help

    Just login the https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/  and change your Apple Id's Password, and if you receive any such Emails in future do not provide your Personal Details and report the same to Apple Immediately.

  • I went out of the U.S.and my iMessage signed me out. Now it won't let me sign in! Someone please HEL, I went out of the U.S.and my iMessage signed me out. Now it won't let me sign in! Someone please, HELP!!!

    Please Help!! I went on vacation in Europe and I was texting people very easily, then one day out of the blue it says my my me email was inactivated and won't work. I know that isn't true though because I email people just fine!! 
           SOMEONE PLEASE HELP!!!   

    If you are using your Apple ID email for Messages, is it still working for all other aspects in the iTunes Store and the App Store ... can you download and update apps?
    I'm not sure at all why your email address would be deactivated by Messages.

  • Applet Problem. Please Help.

    Hello,
    I've written an rmi-based application and would like to run a client side as an applet. My client app works fine when I type: "appletviewer app1.html" but when I run it in a web browser, none of the *.gif images are there. Can somebody please tell me why I can't see *.gif images in web browser? I looked at java.policy and said something like:
    grant codeBase "file:C:/Sun/AppServer/jdk/bin/*" {
         permission java.security.AllPermission;
    with no effect
    I then read CoreJava book and implemented:
    grant
    permission com.sun.rmi.rmid.ExecPermission
         "${java.home}${/}bin${/}java";
         permission com.sun.rmi.rmid.ExecOptionPermission
         "-Djava.security.policy=*";
    and this one too:
    grant
         permission java.security.AllPermission;
    But, I am not sure what to do with these policy files other than add them in the \jre\lib\security directory. Please tell me what should I do?
    Thank you,
    Victor.

    i have created an applet and its button work fine when i load it in appletviewer but when i load it in IE or NN these buttons do not work . i get the following errors.
    Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
         at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at Applet2.button6_MouseClicked(Applet2.java)
         at Applet2$SymmetricalMouse.mouseClicked(Applet2.java)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    can somebody tell me why this happens ? could this be a version problem.
    regards
    Sudhir Venugopal

  • Wrong sign in COPA.  please help!

    Hi,
    I'm an SD consultant, so forgive me if this question is a bit fuzzy.  I need help figuring out how the +/- signs are used in COPA.
    I have two COPA postings, both from Debit Memos, and both posting to cost elements with category 12.
    1) Condition Type Y represents Deferred Costs.  It is posted via SD to FI with a DR and to PA with a DR.
    2) Condition Type Z represnts Royalty Income, but we want it reflected <i></i>not as income, but as a credit to cost<i></i>.  It is posted via SD to FI with a <b>CR</b> and to PA with a DR.  However, if I make a manual posting in FI, it is reflected in PA correctly.
    Does anyone have ideas as to why this is happening?  The condition types only differ in the Plus/Minus setting (Y = ' ' either  ; Z = 'A' positive) and the Condition Category field.  Both conditions are transferred to PA with "Transfer +/-" = ' '.
    Thanks!!!!
    Ben
    [email protected]

    Hi Ben,
    Please check if in pricing condition if Transfer values with +/- signs flag is ON
    Also please refer below link:
    http://searchsap.techtarget.com/searchSAP/downloads/10_ConsultingNotes_forCO-PA_Analysts.pdf
    Please assign points as way to say thanks

  • Problems understanding open text for access, please help

    Hi all,
    I'm experiencing some problems with this script, and I think knowing what the error is will help me a lot to understand better how applescript handles access to files.
    When i launch this script it tells me somethihng like "document some object has not been opened" (could be slightly different in english).
    So, i guess is a problem with openening and closing, but as you can see i open and close the doc, so I shouldn't encounter this problem. Do I?
    Thanks for any tip!
    set Report to "myfile.txt"
    -- in case previously not closed I'll close again
    try
      close access Report
    end try
    set the_file to (open for access Report with write permission)
    write return to the_file starting at eof
    write "test" to the_file
    write return to the_file
    write return to the_file
    close access the_file
    repeat with numero from 1 to 3
      write numero to the_file starting at eof
      write return to the_file
      write return to the_file
      close access the_file
    end repeat

    Each time your application is run the files associated with it will also be released, so all you need to do is make sure that each open is balanced with a close.  This can be done easiest by using a handler that has been tested, so you don't have to worry about leaving something out elsewhere in your script.  For example:
    on run -- example
              set report to ((path to desktop) as text) & "myFile.txt"
      write_toFile_("testing one" & return, report)
      write_toFile_("testing two, three" & return, report)
      write_toFile_("testing again" & return, report)
    end run
    on write_toFile_(someThing, someFile)
      try
        set theOpenFile to (open for access someFile with write permission)
        write someThing to theOpenFile starting at eof
        close access theOpenFile
      on error -- make sure file is closed on any error
        try
          close access theOpenFile
        end try
      end try
    end write_toFile_

  • Applet not working - Please Help!

    Hi everybody,
    I'm trying to make this calculator program work as an applet AND as an application. I tried using:
    public class calcg extends JApplet implements ActionListener{ in many different ways, but it didn't work. Can sombody help me make it work?
    Below is the source code for my calculator program.
    Thanks in advance,
    -Maria
    ps-You can also e-mail me at [email protected]
    // calculator
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class calcg extends JFrame implements ActionListener
      private JButton one, two, three, four, five, six, seven,
    eight, nine, zero, dec, eq, plus, minus, mult, div, clear;
      private JLabel output, spacer;
      private Container container;
      private String operation;
      private double num1, num2, answer;
      private boolean clear_flag = false;
      //set up GUI
      public calcg()
        //Create Title
        super("Calculator");
        JPanel container = new JPanel();     
        container.setLayout( new FlowLayout( FlowLayout.CENTER
        output = new JLabel("");     
        output.setBorder(new MatteBorder(2,2,2,2,Color.gray));
        output.setPreferredSize(new Dimension(1,26));     
        getContentPane().setBackground(Color.white);     
        getContentPane().add( "North",output );     
        getContentPane().add( "Center",container );
        //set up spacer
        spacer = new JLabel( "                                        
        container.add( spacer );
        //set up clear
        clear = new JButton( "CE" );
        clear.addActionListener(this);
        container.add( clear );
        //set up seven and register its event handler
        seven = new JButton( "7" );
        seven.addActionListener(this);
        container.add( seven );
        //set up eight
        eight = new JButton( "8" );
        eight.addActionListener(this);
        container.add( eight );
        //set up nine
        nine = new JButton( "9" );
        nine.addActionListener(this);
        container.add( nine );
        //set up div
        div = new JButton( "/" );
        div.addActionListener(this);
        container.add( div );
        //set up four
        four = new JButton( "4" );
        four.addActionListener(this);
        container.add( four );
        //set up five
        five = new JButton( "5" );
        five.addActionListener(this);
        container.add( five );
        //set up six
        six = new JButton( "6" );
        six.addActionListener(this);
        container.add( six );
        //set up mult
        mult = new JButton( "*" );
        mult.addActionListener(this);
        container.add( mult );
        //set up one
        one = new JButton( "1" );
        one.addActionListener(this);
        container.add( one );
        //set up two
        two = new JButton( "2" );
        two.addActionListener(this);
        container.add( two );
        //set up three
        three = new JButton( "3" );
        three.addActionListener(this);
        container.add( three );
        //set up minus
        minus = new JButton( "-" );
        minus.addActionListener(this);
        container.add( minus );
        //set up zero
        zero = new JButton( "0" );
        zero.addActionListener(this);
        container.add( zero );
        //set up dec
        dec = new JButton( "." );
        dec.addActionListener(this);
        container.add( dec );
        //set up eq
        eq = new JButton( "=" );
        eq.addActionListener(this);
        container.add( eq );
        //set up plus
        plus = new JButton( "+" );
        plus.addActionListener(this);
        container.add( plus );
        //Set size and make visible
        setSize( 190, 225 );
        setVisible( true );
        setResizable( false );
      public void actionPerformed(ActionEvent ae)
        JButton but = ( JButton )ae.getSource();     
        //Handle what button was pushed
        //Action for dec button
        if( but.getText() == "." )
          //if dec is pressed, first check to make shure there
    is not already a decimal
          String temp = output.getText();
          if( temp.indexOf( '.' ) == -1 )
            output.setText( output.getText() + but.getText() );
        //Action for clear button
        else if( but.getText() == "CE" )
          output.setText( "" );
          operation = "";
          num1 = 0.0;
          num2 = 0.0;
        //Action for plus button
        else if( but.getText() == "+" )
          operation = "+";
          num1 = Double.parseDouble( output.getText() );
          clear_flag = true;
          //output.setText( "" );
        //Action for minus button
        else if( but.getText() == "-" )
          operation = "-";
          num1 = Double.parseDouble( output.getText() );
          clear_flag = true;
          //output.setText( "" );
        //Action for mult button
        else if( but.getText() == "*" )
          operation = "*";
          num1 = Double.parseDouble( output.getText() );
          clear_flag = true;
          //output.setText( "" );
        //Action for div button
        else if( but.getText() == "/" )
          operation = "/";
          num1 = Double.parseDouble( output.getText() );
          clear_flag = true;
          //output.setText( "" );
        //Action for eq button
        else if( but.getText() == "=" )
          num2 = Double.parseDouble( output.getText() );
          //handle addition
          if( operation == "+" )
            answer = num1 + num2;
          else if( operation == "-" )
            answer = num1 - num2;
          else if( operation == "*" )
            answer = num1 * num2;
          else if( operation == "/" )
            answer = num1 / num2;       
          //display answer in output field
          output.setText( String.valueOf( answer ) );
          clear_flag = true;
          operation = "";
        //Default action should only be used for numbers
        else
          if( clear_flag == true )
            output.setText( "" );
            clear_flag = false;
          output.setText( output.getText() + but.getText() );
      //execute application
      public static void main( String args[] )
        calcg application = new calcg();
        application.setDefaultCloseOperation(
    JFrame.EXIT_ON_CLOSE );
    }

    Ok I think I know what you problem is.
    First move the main method above the calcg method ok. Just to make it easy.
    Then you did something like
    public static void main( String args[] )
    calcg application = new calcg();
    >> application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); }}
    the arrows indicate your error. You need to put the setDefaultCloseOperation inside the calcg method then you would put this:
    public static void main(String[] args)
    calcg application = new calcg();
    application.calcg();
    see you call the application to run the calcg method which will start your program.

  • Signed Applet to Access Smart Card Reader

    I am trying to develop an applet that will access a smart card on the client's side. The applet will need to load the PKCS#11 library(.dll) from the client side.
    What is the most secure way to implement this design?
    1 solution I am think of is to use Java Web Start which will download the applet onto the client desktop. Is this the right way?
    Is there a solution where the applet can run in the browser and access the smart card without downloading the applet?
    Thanks.

    This is a duplicate of this and is probably better dealt with in the WebStart forum. I'm locking this thread.

Maybe you are looking for

  • Mac stuck in safe mode start up loop

    Hi everyone, it seems I have run into a problem and can't find answers online. First off I have a MacBook intel core duo on the latest snow leopard and mac software is up to date. It all started when I had to restore my iPhone and it had some problem

  • Files/Folders Sticking to Mouse Pointer - Not Releasing (Reset PRAM & Apple Hardware Test Fail to Run)

    I've been having two issues with my Late 2008 MacBook Pro 15-inch - Running OS X 10.8.5 (Mountain Lion).  Unable to Reset the PRAM and Run Apple Hardware Test (AHT). On a random basis - File/Folder icons are Sticking to the Mouse Pointer - Not Releas

  • Two charges were made for in-app purchase

    Hi, this has happened two time in the course of 1 month. I've made two in-app purchases from two different apps throughout the month. And both times, i was charged twice the amount of the price of the item, here's the story.. LINE app 800 coins - a m

  • Export frame as EPS from the web

    I've done quite a bit of research on the subject and looked at various tutorials. I keep running into brick walls. Here was one for exporting as a JPEG. http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php This might work if not for the

  • Activating an old copy of CS2

    Hi I recently bought my daughter an iMac on eBay for schoolwork. For my business I have long owned licensed copied of CS2 and 3. I wanted to install CS2 on her iMac so she could access Photoshop and Illustrator in case she wanted to teach herself som