A function can not be used in Applet.what' wrong?

Here is a function.
          private String LoadFile() {
String input;
          String output="sssssdsdsddf";
          try{
          FileReader f=new FileReader("shu.txt");
BufferedReader in = new BufferedReader(f);
while ((input = in.readLine())!= null){output=output+input;}
          in.close();
          }catch(IOException e) {   
               System.err.println("Exception caught: " + e.getMessage());
return output;
It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

Don't you think it would be a bit of a security risk if any applet you downloaded from the web (unknowingly) could read/write to your file system....
Applets have strict security applied to them, and file i/o is one of the restrictions. There are ways around it, but for the moment I'd suggest you build a bridge and get over it.
Cheers,
Radish21

Similar Messages

  • A function can not be used in Applet.what's wrong?

    Here is a function.
    private String LoadFile() {
    String input;
    String output="sssssdsdsddf";
    try{
    FileReader f=new FileReader("shu.txt");
    BufferedReader in = new BufferedReader(f);
    while ((input = in.readLine())!= null){output=output+input;}
    in.close();
    }catch(IOException e) {
    System.err.println("Exception caught: " + e.getMessage());
    return output;
    It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1215-security.html#sidebar1

  • IOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    iOS Cangjie input method can not be used. Original with Space Bar word selection function is invalid, as soon as possible to solve, it will affect the most users in Taiwan and Hong Kong.

    No PR1.2 Firmware update, No update for Nokia Messaging, No updates for Ovi Maps .... Why is the N900 the forgotten stepchild ?
    "PR1.2 is still being tested - http://twitter.com/luovanto/statuses/13087245356"
    Hong Kong Launch http://www.youtube.com/watch?v=pY8zCBzvQLo

  • How does one know whether or not they use "Java applets"?

    The support doc for the recent Java update (Update 8, for Snow Leopard), entitled "About Java for Mac OS X 10.6 Update 8," advises the following:
    If you do not use Java applets, it is recommended that you disable the Java web plug-in in your web browser.
    How does one know whether or not they use "Java applets"?
    Thanks.
    URL:  http://support.apple.com/kb/HT5243

    K.S. wrote:
    dymar wrote:
    Also, how would I know that a missing applet was causing some feature(s) not to work in a situation where no error mesage was returned?
    Sometimes you have to dig to find out: http://earthnow.usgs.gov/earthnow_app.html
    doesn't tell you directly, but it is mentioned in the FAQ that Java is required. If the content is appropriate, you can always ask here.
    Thanks.  According to that webpage, my "Java is out of date."  When an error message like that is returned, I guess it's clear that "it's a Java problem."  Presumably, one would then just go to java.com and download the applet if he/she wanted to view the webpage.
    I was wondering more about situation when unexplained problems that involved missing Java applets weren't noted in error messages.
    But maybe I'm worrying about something that doesn't really need to be worried about.

  • HT201335 when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?

    when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?  My son's Ipad(same as kind as mine) works ok with the apple tv but mine does not.  Any suggestions?

    Hello Nina Izurin,
    While written for the iPhone, the troubleshooting below can help resolve issues with your iPad's camera, as well.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • Cant open PDF files..It says the adobe acrobat reader that is running can not be used to view files in a browser..plz suggest the solution.thanks

    Whenever i try to open a PDF file it says " The adobe/acrobar reader that is running can not be used to view files in a web browser. Plz exit adobe/acrobat readerand exit your web browser and try again." Wt do i need to do, plz suggest.
    Regards
    Aditya Bhargava

    Hi adityabhargava01-
    My first suggestion is to upgrade to the most recent version of Firefox by going to this link:
    http://www.mozilla.org/en-US/firefox/new/
    My second suggestion is to read this article on how to many your preferences on how Firefox deals with PDFs and all other file types:
    [[Options window - Applications panel]]
    I hope that helps!

  • AdobeAcrobat/Reader that is running can not be used to view PDF Files in Web Browser...what do I need to do to fix this..

    I just got Windows 7 and have been having problems since loading it. Most of my drivers only go to Vista and don't recognize 7.
    I have trying to download some manuals from their website
    and keep getting this message; Adobe Acrobat/reader that is running can not be used to view PDF files in Web Browser.

    Could I suggest a workaround for PDFs until a solution is posted? Open them directly in the Adobe application rather than in a browser tab.
    In your Adobe application(s), go to:
    Edit > Preferences > Internet
    Then uncheck "Display PDF in browser"
    (There are very few sites where having PDF integrated is really beneficial.)

  • Chrome - Adobe-Acrobat/Reader can not be used to view PDF files in a web browser.

    I can't view PDF files via Chrome (it works on Internet Explorer but I prefer Chrome)  -  the error below has arisen recently on Chrome, though I can't see what has changed.
    "Acrobat plug-in
    The Adobe-Acrobat/Reader that is running can not be used to view PDF files in a web browser. Please exit  Adobe Acrobat/Reader and exit your Web Browser and try again."
    I have looked through Forum articles on similar errors and have tried the following(text copied from other Forum entries)
    Repair Adobe Acrobat (from Acrobat)
    Repair Adobe Acrobat (from Control Panel
    Configure Acrobat  as a helper application: Choose Edit > Preferences., Select Internet on the left., Deselect Display PDF In Browser Using [Acrobat application], and then click OK.Quit Acrobat or Reader
    Create a registry item for Acrobat: with Regedit: If the registry item doesn't exist on the system, do the following: Go to Edit > New > Key and create the missing HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe.Go to Edit > New > String Value and name this key (Default).Select (Default), and then go to Edit > Modify. Type the Adobe Acrobat path in the "Value data" for your product.,restart your computer
    Repair the HKCR\AcroExch.Document registry key: Navigate to HKEY_CLASSES_ROOT\AcroExch.Document., Right-click AcroExch.Document and select Delete; make sure that you have the correct key, and click Yes on any prompts, Right-click AcroExch.Document.7 and select Delete; make sure that you have the correct key, and click Yes on any prompts. Repair your Acrobat  installation
    None has solved the problem. However it still works ok with IE. But I want to stick with Chrome because I find IE is so slow!
    I am using Vista, with Adobe Acrobat standard 9.5.2 and Google Chrome version 23.0.1271.64 m which is marked on Chrome as 'up to date'
    Does anyone know why I might be getting this error on Chrome but not IE?

    I think I have discovered the answer to my own question!
    I have disabled Adobe Reader plug-in, and can now see PDFs in Chrome.
    (Steps: Chrome Menu, Settings option, Click Advanced Settings link, then Content Settings button, then select Disable Individual Plug-Ins, and a list of plug-ins is offered to enable or disable).
    I then get a different result depending on whether or not Chrome PDF viewer is enabled - with it enabled I see the PDF document in Chrome, or with it disabled then the option is offered to download it, but either way I can get it it via Chrome without having to run Internet explorer in another browser window.

  • Reader 9.2 - "can not be used to view PDF files in a web browser"

    Hello,
    I recently deployed Adobe 9.2 within our organization. I used the Adobe Customization Wizard 9 to transform the install set, and selected the "Display PDF in Browser" option as default.
    When opening a PDF linked from a web URL, we get the message: "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Adobe Acrobat/Reader version 8 or 9 is required. Please exit and try again." This occurs under IE8 and IE6, in both Windows XP SP2 and Windows 7.
    If I launch Adobe Reader and unselect "Display PDF in Browser" in preferences, PDFs open normally.

    I think I have discovered the answer to my own question!
    I have disabled Adobe Reader plug-in, and can now see PDFs in Chrome.
    (Steps: Chrome Menu, Settings option, Click Advanced Settings link, then Content Settings button, then select Disable Individual Plug-Ins, and a list of plug-ins is offered to enable or disable).
    I then get a different result depending on whether or not Chrome PDF viewer is enabled - with it enabled I see the PDF document in Chrome, or with it disabled then the option is offered to download it, but either way I can get it it via Chrome without having to run Internet explorer in another browser window.

  • Adobe Acrobat/Reader can not be used to view PDF's in Web browser.

    Does any one came accross the following message trying to view PDF's in web browser? "Adobe Acrobat/Reader that is running can not be used to view PDF documents in Web browser. Please exit the Acrobat?Reader application and try again". Thanks for your help! Barbara

    http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html

  • Adobe 9.1.3 and FireFox 3.5.1+ "...can not be used to view PDF files in a Web Browser"

    This is the issue but I'm not sure there is a resolution:
    Firefox:  Version 3.5.1
    Adobe: Version 9.1.3
    When navigating the web, click a URL that opens a PDF inside the browser and you get an error * "The Adobe Acrobat/Reader that is
    running can not be used to view PDF files in a Web Browser".  Please exit Adobe Acrobat/Reader and exit your Web Browser and try again".  I did read a post that doing a "repair" from the Adobe Reader application should fix this, they also reference a few registry keys to check becuase the post states it's lost the application path to Adobe version X.  I don't necessarily buy that "fix" and here are my details below.
    In FireFox if you navigate to Tools > Options > Applications > Adobe Acrobat Document
    You're given choices:
    Always ask:  DOES NOT WORK, produces afore mentioned error *
    Save File:  Works, saves the file to a directory on your PC
    Use Adobe Reader 9.1 (defau...:  Works, opens your PDF's outside of your web browser
    Use Adobe Acrobat (in Firefox):  DOES NOT WORK, produces afore mentioned error *
    Use other...:
    IE seems to just work as expected.
    If you open Adobe Reader > Edit > Preferences > Internet > Check "Display PDF in browser" - DOES NOT WORK, produces afore mentioned error *
    This would seem to be an Adobe error rather than a FireFox web browser problems since FireFox does seem to know the correct path although I suppose you can't rule out that this is a FireFox problem since 2 out of the 4 PDF open options DON'T WORK.
    Any thoughts on this issue would be greatly appreciated.
    Other information:
    Adobe 8.1.5 works perfectly with FF 3.5.1+ when opening PDF's in the web browser, we also had no problems with previous versions either.
    MSI push via Active Directory from Adobe 8.1.5 upgrade to Licensed Distribution I signed up for, Adobe 9.1.3 which was upgraded from 9.1.0, to 9.1.2, to 9.1.3 via an MSP patch.
    Operating system:  Windows XP SP 2, plenty of RAM, plenty of Drive
    IE version this works with the new version of Adobe 9.1.3 is version 7 (7.0.5730.13)
    Our FireFox MSI's come from Front Motions website and as far as I know we've never had problems with their MSI's, also tried the new release of FF 3.5.2 from their website.
    I think that about covers it.  Anyone else experiencing the same problems or have a patch?

    After troublshooting this for the entire day today the issue seems to be a MIME problem.
    If everything is woking perfectly, in Tools > Options > Applications...
    You should see 4 or more things related to Adobe like "Adobe Acrobat Forms Document", etc.  If you don't see at least 4 MIME entries either your Adobe installation is hosed or your FF installation is hosed.  I haven't figured out which is causing the issue.
    What I did was remaster my patches from my original Adobe 9.1.0 MSI with the two updates via the command line in the directories with the source files.  On the 9.1.0 original file I first remastered my MST transform with the Adobe MST utility.  I then applied my patches.
    msiexec /a AcroRead.msi /p AdbeRdrUpd912_all_incr.msp
    msiexec /a AcroRead.msi /p AdbeRdrUpd913_all_incr.msp
    I then uploaded that to my network share, unlinked my group policy, made a new group policy, added a batch file to delete adobe.com from program file and the desktop on system startup even though my MST was supposed to take care of that - it's not a perfect world is it?  :-)
    I then reapplied my GPO's for both FireFox 3.5.2 and Adobe 9.1.3, I checked to make sure the MIME extensions were there and they were.  You might have to go into your Adobe Preferences and select that open in browser setting depending on what happens or adjust your MIME settings in FireFox's options but it should work.
    That's what worked for me.  It's possible a few other things I did along the way tweaked it out, in my group policy on the first run I did select to upgrade previous group policies, for the remaster and repush I didn't select any previous GPO's to upgrade.
    It's hard to tell what one thing tweaked it out or what combination of things tweaked out the install.  I did also reinstall Adobe 8.1.5 and FF 3.0.10 before doing all this since our machines currently have that setup, I'm not sure if that affected it either, it's just hard to tell but I don't think it did simply because I had done that several times in troubleshooting this issue.
    If anyone else has more specifics that would be great!

  • This phone can not be used because the apple mobile device service is not started

    i plug my iphone into my computer and the message this phone can not be used because the apple mobile device service is not started pops up and wont let me download any music onto my phone. what can i do to make that stop happening?

    See Here
    http://support.apple.com/kb/TS1567

  • This iphone can not be used because the required software is not installed. Run the itunes installer to remove itunes, then install the 64bit version of itunes

    This iphone can not be used because the required software is not installed. Run the itunes installer to remove itunes, then install the 64bit version of itunes
    I keep getting the above error everytime I plug in my iphone.
    I am not daft, I do have the 64bit version of iTunes installed already. When I installed itunes 10.5 and more recently 10.5.1 I got an error message that rolls back a section of the installation (The updater I think) before finishing off installing iTunes.
    After the installation iTunes will work normally apart from when I try to connect a device. At which point I get the title error message and I can not sync my phone.
    It's probably down to Itunes not installing properly however no matter what I try I can not sort the problem out. I've tried uninstalling all apple programmes followed by a registry clean, then reinstall. I've tried the same again but in a specific order. I've tried repairing iTunes, repairing the updater etc etc. Nothing seems to work. I'm out of ideas.
    Has anybody had this problem? Please can somebody tell me how to fix it!
    Getting an iPad this Christmas and if I can't sync that up to my PC I may just have to go over to ANDROID!!!

    Is there a way to install this on its own?
    Yeah, let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunes64Setup.exe installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunes64Setup.exe, and select "Extract to iTunes64Setup". WinRAR will expand the contents of the file into a folder called "iTunes64Setup".
    Go into the folder and doubleclick the AppleMobileDeviceSupport64.msi to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport64.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, does an iTunes install go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

  • Please help i am going off my mind when i connect my iphone 4 to my mac it tells me it can not be used because it requires 10.6.3 or later my mac is operating on 10.6.8 and my itunes is 10 .5 yet the iphone does not even show up in devices please help

    please help i am going off my mind since i updated my iphone 4 when i go to sync it tells me it can not be used as it requires 10.6.3 or higher
    my mac is running on 10.6.8 and i upgraded my itunes to 10.5 everything seems to be in place but the phone is not even being recognised in
    devices although it does come up in iphoto if anybody can help i would be very grateful.

    You have answered your own question:
    "requires 10.6.3 or higher"
    " i upgraded my itunes to 10.5 "
    You need itunes 10.6.3 or later.

  • Hello i can  not  i use my account on the applewill   store , i hope that yu help  me with a lot of thanks and wait reply to this massege

    hello i can not i use my account  on the apple store  , i hope  that yu will  help me  with  a  lot  of thanks and wait  reply to this message

    Go through the below link.
    http://support.apple.com/kb/ts2446
    If the above link doesn't helps then contact APple support and they will help you Enable your Apple Id from their End : http://support.apple.com/kb/he57

Maybe you are looking for