Can check the code for me??

import java.io.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.filechooser.*;
import java.applet.*;
public class Mplayer extends Applet
     JButton openButton;
     JButton cancelButton;
     JFileChooser fc;
     int returnVal;
     public void init()
          fc = new JFileChooser();
          returnVal = fc.showOpenDialog(this);
     public void start()
          if(returnVal == JFileChooser.APPROVE_OPTION)
               File file = fc.getSelectedFile();
               String path = file.getPath();
               System.out.println("Opening: " +file.getPath());
          else
               System.out.println("Cancelled by user");
-- this code can be compiled, but when i open this applet, the 1st error is about java.security.AccessControlException, i think got some problem about " returnVal = fc.showOpenDialog(this);".. can help me to figure out..?? --

Try this: this (ie: 'grant{ ...' isn't an Internet solution but it should allow you to use your app locally in appletviewer and develop your skills unhindered
// not tested
import java.io.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.filechooser.*;
public class Mplayer extends JApplet{
   JButton openButton;
   JButton cancelButton;
   JFileChooser fc= new JFileChooser();
   int returnVal;
   public void init(){
      grant{ permission java.security.AllPermission; };
      returnVal = fc.showOpenDialog(this);
      if(returnVal == JFileChooser.APPROVE_OPTION){
         File file = fc.getSelectedFile();
         String path = file.getPath();
         System.out.println("Opening: " +file.getPath());
      else System.out.println("Cancelled by user");

Similar Messages

  • URGENT check the code for vendor ageing (Give Solution)

    hi this is the code which i am using to calculate the
    ageing but not able to get the result.
    every time the result is 0.plz suggest me the solution.
    its very urgent.
    *& Report  Z_VENDOR AGEING                                                    *
    *&  in this repoet I am calculating the vendor ageing
        which is depending on formula
        AGEING = Current Date(or any date entered by user) – Bline Date(BSIK-zfbdt) 
    REPORT  z_vendor  NO STANDARD PAGE HEADING
                      LINE-SIZE 200
                      LINE-COUNT 65(3).
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
           bukrs LIKE bsik-bukrs,
           saknr LIKE bsik-saknr,
           bldat LIKE bsik-bldat,
           wrbtr LIKE bsik-wrbtr,
           lifnr LIKE bsik-lifnr,
           zfbdt like bsik-zfbdt,
           ageing type i,
           END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
                     s_saknr FOR bsik-saknr,
                     s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
           FROM bsik
           INTO  TABLE t_out
           WHERE saknr IN s_saknr
           AND bukrs IN s_bukrs
           AND lifnr IN s_lifnr.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = p_date1
        i_datum_von                   = t_out-zfbdt
      I_KZ_EXCL_VON                 = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                  = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
    IMPORTING
       E_TAGE                        = t_out-ageing
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT t_out.
      WRITE : / t_out-saknr,
                t_out-lifnr,
                t_out-wrbtr,
                t_out-zfbdt,
                t_out-ageing.
    ENDLOOP.

    hi sanjeev,
    still problem there.
    dont worry. just copy this code.
    try this code.
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
    bukrs LIKE bsik-bukrs,
    saknr LIKE bsik-saknr,
    bldat LIKE bsik-bldat,
    wrbtr LIKE bsik-wrbtr,
    lifnr LIKE bsik-lifnr,
    zfbdt like bsik-zfbdt,
    ageing type i,
    END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
    s_saknr FOR bsik-saknr,
    s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
    FROM bsik
    INTO <b>corresponding fields of</b> TABLE t_out
    WHERE saknr IN s_saknr
    AND bukrs IN s_bukrs
    AND lifnr IN s_lifnr.
    <b>loop at t_out.</b>
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    i_datum_bis = p_date1
    i_datum_von = t_out-zfbdt
    I_KZ_EXCL_VON = '0'
    I_KZ_INCL_BIS = '0'
    I_KZ_ULT_BIS = ' '
    I_KZ_ULT_VON = ' '
    I_STGMETH = '0'
    I_SZBMETH = '1'
    IMPORTING
    E_TAGE = t_out-ageing
    EXCEPTIONS
    DAYS_METHOD_NOT_DEFINED = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>modify t_out.</b>
    clear t_out.
    <b>endloop.</b>
    LOOP AT t_out.
    WRITE : / t_out-saknr,
    t_out-lifnr,
    t_out-wrbtr,
    t_out-zfbdt,
    t_out-ageing.
    endloop
    rgds
    anver
    Message was edited by: Anversha s

  • Please check the code for me

    DATA :Begin of itab_reqid occurs 0,
          objid like hrp1001-objid,
           end of itab_reqid,
          Begin of itab_postid occurs 0,
           postid like hrp1001-objid,
           end of itab_postid.
    Select distinct objid from hrp5125 into table itab_reqid
                                     where aedtm BETWEEN '20060107' and '20073108'.
    Select OBJID from hrp1001 into table itab_postid where objid IN itab_reqid
                                                           AND SCLAS = 'NC'.
    The above code gives an error called "line type for itab_reqid is incorrect".
    Please advise,
    Thanks

    Hi Reena,
    I am not sure if your approach works for ranges. I think the problem in your code is that itab_reqid is not a range and yet you have used it like a range in your SQL SELECT where clause.
    You could try this approach instead:
    DATA :Begin of itab_reqid occurs 0,
                 objid like hrp1001-objid,
               end of itab_reqid,
               Begin of itab_postid occurs 0,
                 postid like hrp1001-objid,
               end of itab_postid.
    RANGES: r_reqid for hrp1001-objid.
    Select distinct objid from hrp5125 into table itab_reqid
    where aedtm BETWEEN '20060107' and '20073108'.
    if not itab_reqid[] is initial.
      r_reqid-option = 'EQ'.
      r_reqid-sign = 'I'.
      LOOP AT itab_reqid.
         r_reqid-low = itab_reqid-objid.
         append r_reqid.
      ENDLOOP.
      Select OBJID from hrp1001 into table itab_postid where objid IN itab_reqid
         AND SCLAS = 'NC'.
    endif.
    Kind Regards,
    Darwin

  • I need the code for creating popup windows and code for open and close

    I can write the code for creating popup window , i am getting problem while trying to open and closing that popup windows.
    Can anybody help me in that pls ?
    Regards
    Sreeni.

    Hi
    For pop up window
    IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
    IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    window.setWindowPosition (300, 150);
    window.show();
    wdContext.currentYourNodeElement().setPopupAttribute(window);
    For closing window code
    IWDWindow window = wdContext.currentYourNodeElement().getPopupAttribute();
    window.hide();
    window.destroyInstance();
    For more infornation refer this link
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68&overridelayout=true
    This link is very useful for you.
    Regards
    Ruturaj
    Edited by: Ruturaj Inamdar on Aug 13, 2009 9:10 AM

  • Where we can check the Sales order cancel reason?

    Hi,
    We are developing a custom report for Sales Order Booked Vs Cancelled. In this report we want to display the reason for canceling the order. We are selecting the reasons while canceling the sales order. But the reasons are not showing in the tables. Where we can check the reason for canceling? Is there any table?
    Regards,
    Prabhu.S.J

    Check this query:
    SELECT FLT.MEANING, OER.REASON_TYPE, OER.REASON_CODE, FLV.MEANING, OER.COMMENTS, OER.CREATION_DATE, OER.REASON_ID, OER.ENTITY_ID, OER.ENTITY_CODE, OER.VERSION_NUMBER, OER.HEADER_ID from OE_REASONS OER, FND_LOOKUP_VALUES FLV, FND_LOOKUP_TYPES_VL FLT WHERE FLV.LANGUAGE = userenv('LANG') and FLV.VIEW_APPLICATION_ID = 660 and FLT.VIEW_APPLICATION_ID = 660 and FLT.SECURITY_GROUP_ID = fnd_global.lookup_security_group(FLT.LOOKUP_TYPE, FLT.VIEW_APPLICATION_ID) and FLV.SECURITY_GROUP_ID = fnd_global.lookup_security_group(FLV.LOOKUP_TYPE, FLV.VIEW_APPLICATION_ID) and FLV.LOOKUP_TYPE=FLT.LOOKUP_TYPE and OER.REASON_TYPE=FLV.LOOKUP_TYPE and OER.REASON_CODE=FLV.LOOKUP_CODE;
    It might help you.

  • Check the filtering for an index

    Hi,
    Can anyone please tell me how I can check the filtering for an index? Thanks for your valuable time.
    Sincerely,
    Sri

    hi Patricio,
    Sorry for interfering with your patient step by step reply.
    Hi Sri,
    In case you are using a file repository, and few of your documents are getting indexed and few not, while all belong to the same data source, and if the error is "Preparation Failed" for a few documents, then it might be becos the documents that are not indexed are of size > 10KB. And the documents that got indexed are becos they are of size < 10KB.
    If it does not help, hope Patricio will continue analysing your problem.
    best regds,
    Alagammai.

  • I didnt konw how to make a new account for my iTues card so i did it with a diffrent email but that email doesnt exist and when i tried to make it on a real email i just sai invalid code check the code and try again and can u please help me

    please help me it is a card of 25 dollars and i dont want it to go to waist i by mistake thought you used a frake email so i made one up i thought i was going to have a new one but then it said it was going to send a verifaction to my email so then i tried to use a real email and put in the code but it just kept on saying invalid code. check the code and try again. and i dont know what to do can u please please help me it was a gift and i really dont want it to go to waist please i need help

    for #1
    Frequently asked questions about Apple ID - Apple Support
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    for #2
    Apple does not accept unsolicited ideas see Apple - Legal - Unsolicited Idea Submission Policy

  • Apple TV keeps asking my for my Credit Card verification code and I punch it in, still asks me for it, and restarted everything, went to my computer, checked the code, all is set, still can't rent a movie. Please help!

    Apple TV keeps asking my for my 3digit  Credit Card verification code and I punch it in, it still asks me for it, and went to my computer on iTunes store, checked the code, all is set and saved, go back to Apple TV still can't rent a movie, I still get the same Verification Required message without any further information after I punch in my 3digits. When I hit submit, the page goes back to the same place to type the code again, and yes the code is 100% accurate. I tried restoring the apple tv, every thing is up to date on all devices and signed in and out of my itunes store on my Mac, still no luck. Please help!

    This issue actually started a week ago... see: https://discussions.apple.com/message/23399558#23399558
    to determine if there are the same problems you are experiencing.  I have spent over 6 hours on this issue trying to isolate if it is a hardware, software, network, iTunes account, or Apple device issue.  My initial results indicate it is a software specific issue related to the Apply TV hardware device.

  • Can not view the code for views, triggers or table definition

    Hello Gurus,
    I can not see the code for any of the triggers, views, tables etc. in sql developer. For instance a view code will be
    "create or replace" and then nothing, I could see the code in the past.
    When clicking on SQL tab for table I get following errors
    1. Ora-00904 Invalid Column name
    2. Ora-31600: invalid input value emit_schema for parameter name in function SET_TRANSFORM_PARAMORA-06512: at SYs.DBMS_SYS_ERROR............................
    please advice.
    Thanks

    Sqldev was only certified starting from 9.0.2, so it's possible that's the culprit. The latest update in the certification document even omits 9i entirely.
    Did it start happening after upgrading sqldev? What version are you on?
    K.

  • This is an error from my HP scanner. How can I fix the problem? An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only.

    I recently uploaded the Maverick operating system. I wanted to scan some things on my HP Printer/Scanner and could not . This is the error message I received: An  error has occurred saving the file because it could not be written to.   Check the properties for the file to make sure it is not read-only. I am a novice with the computer and have no one to help. I hope someone knows an easy fix.
    Thank you

    This worked for me:
    "Although it is not a 'fix' for the HP issue, I did find a workaround that helped me. In the Preferences Panel in MacOS X you can pull up the Printer/Scanner preferences and scan directly from OS X. I'd not known of this prior to posting here and it worked like a charm."
    "Of course, HP should still update their software, but it's good to know that Apple has it covered for them."
    I found it here:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/MAVERICKS-WONT-SCAN-HP-C3 09A/td-p/3052105

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • Can't find code for std web dynpro app but can seeit's name in the package?

    Hi All,
    We're using ECC6 and EPP 7.01 SP4.
    We've recently uploaded some new packages.  Within one is a Portal Buyer role (1.4).  I would like to access the code for one of the standard web dynros.  I retrieved the name of the application from the iview in the portal.  But when I input the application name in se80, it said it didn't exist.  But yet when I look at the package, I can find the application I want in there but it's not in the interface folder, it's in the Applicat. folder.
    I'm new to web dynpro so apologies if it's a stupid question but.. Why is it like this?  What is the difference between an interface and an application?  Is it possible to access the code of the application?
    Package = MMPUR_UI_VIEW
    Application name = MMPUR_UI_PR_APP
    Any help, would be great as I'm totally stumped.
    Thanks in advance,
    Liz.

    Found the component name from the application.  The application is just a link to a component/interface.

  • I scratched the label off on a £25 gift card and it removed the code. How can I get the code for the card?

    I scratched the label off on a £25 gift card and it removed the code. How can I get the code for the card?

    Click here and request assistance. Gift cards are usually if not always final sale because it would be easy enough for someone dishonest to abuse returns or replacements of them.
    (58640)

  • I purchased an itunes gift card for my nephew. I received a confirmation that the credit card had been debited, however he never received a code to activate his gift. Where can I find out the code for my gift voucher?

    I purchased an itunes gift card for my nephew. I received a confirmation that the credit card had been debited, however he never received a code to activate his gift. Where can I find out the code for my gift voucher?

    If you purchased your gift using iTunes, you can resend it. Just follow these steps to resend an unredeemed gift to any address:
    http://support.apple.com/kb/HT1541

  • HT201195 I entered the code for my gift card but I never used it,now I'm trying to use it but it's no there and doesn't let me redeem the code again. What can I do?

    I entered the code for my gift card but I never used it,now I'm trying to use it but it's no there and doesn't let me redeem the code again. What can I do?

    An iTunes gift card can only be redeemed once, you can't enter and redeem its code again. Since you redeemed the card you haven't bought anything (including IAPs and auto-renewing subscriptions), and your account doesn't show a balance ? You've tried logging out and back into your account and seeing if it shows then ?
    My account's balance shows at the top left of the store's page on my computer's iTunes, and by logging in to view my account via the Store > View Account menu option. On my iOS devices it shows at the bottom of, for example, the Featured tab in the App Store app under my account id (or you can view your account via Settings > iTunes & App Stores and it should show on the screen that you are taken to). If the balance is zero then it might not be shown.

Maybe you are looking for

  • Multiple monitors with T430s (Nvidia)?

    I just received the T430s with Nvidia graphics, and am trying to display to two external monitors in addition to the laptop's LCD. Unfortunately, I'm not able to figure out how to do this. The Intel graphics settings only allow for 2 displays total,

  • Stop an Application from Disabling my Screensaver?

    I have an 3rd party application running on my Mac which overrides my screensaver and Energy Saver Display Sleep settings, preventing my screen from ever sleeping or the screensaver from activating. Its a really good Application apart from this single

  • Error S7122: Cannot connect

    I have been using my email that i have with verizon and hot mail under the Sprint mobile email. Now when i try to check my email i get this error message. Error S7122 Cannot connect to the internet . check your connect and try again. I have called Sp

  • Apple Mail not refreshing 'read' message statuses (GMAIL IMAP)

    I have the following reproducible bug, when using three different IMAP interfaces to my GMail account: Apple Mail, iPhone Mail, GMail Web 1. Viewing a mail in Apple Mail, causes it to be marked as read in iPhone Mail and GMail Web 2. Viewing a mail i

  • Backing up version 2.0

    Previously, after buying and installing version 1.1.4, i had to format my hard-drive and when I reinstalled everything, had to contact Apple as I didn't back up the v.1.1.4 update file. Does anyone know where the v2.0 file is stored and how I can bac