How to open and save file like the Notepad Demo do?

I am a newer to Java Web Start. I found that in the Notepad Demo, when user try to open or save file, a message box appear and give the user some security suggestions.
In my application, I used a JFileChooser and set the <security> element to <j2ee-application-client-permissions/> in the jnlp file. But the application will thow an exception:
access denied (java.io.FilePermission C:\Documents and Settings\Administrator\desktop\Java Web Start.lnk read)
Can someone tell me how to solve this problem. By the way, where can I find the source of the Notepad Demo. I want my application to open and save file just like the Notepad Demo do.

The Notpad demo uses the JNLP api to read and write files. The api doc can be found at:
http://java.sun.com/products/javawebstart/docs/javadoc/index.html
Although the Notpad demo source is not available, there is other sample code available at:
http://developer.java.sun.com/developer/releases/javawebstart/
Included here is the webpad demo, which uses the FileOpenService and
FileSaveService API's.

Similar Messages

  • How to Open and Save files

    I have a problem to open and save the files.here is my code. can anyone help me to open the files.
    public void actionPerformed(ActionEvent e) {
    if ("open".equals(e.getActionCommand())) {
    FileDialog fdopen=new FileDialog(this, "Load File", FileDialog.LOAD);
    fdopen.show();
    Thanks for ur time

    Hi fbnmir or who ever can answer my question,
    My problem is similar to the code you wrote. I'm trying to make (or rather complete a half done) editor for text files. For opening and saving files I have so far:
    public void actionPerformed(ActionEvent ae){
    FileDialog filedialog;
    final SearchDialog searchDialog;
    String arg = (String)ae.getActionCommand();
    // the Open ... case
    if(arg.equals(Editor.fileLabels[0])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[0] +
                        " has been selected");
    filedialog = new FileDialog(editor, "Open File Dialog", FileDialog.LOAD);
    filedialog.show();
    if(Editor.VERBOSE){  
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Open file = " + filedialog.getFile());
    System.err.println("Open directory = " + filedialog.getDirectory());
    //the Save ... case
    if(arg.equals(Editor.fileLabels[1])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[1] + " has been selected");
    filedialog = new FileDialog(editor, "Save File Dialog", FileDialog.SAVE);
    filedialog.show();
    if(Editor.VERBOSE){ 
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Save file = " + filedialog.getFile());
    System.err.println("Save directory = " + filedialog.getDirectory());
    These are two components of a MenuHandler class. The problem with this code is that in the text editor window, even if the Open button is pressed the file I want to open isn't displayed. Although the System.err (I think that's what it is called) says:
    Open ... has been selected
    Exited filedialog.setVisible(true);
    Open file = tutorial_01.rtf
    Open directory = C:\dhruba\epgy_2006\tutorial\
    Save ... has been selected
    Exited filedialog.setVisible(true);
    Save file = test.txt
    Save directory = C:\dhruba\epgy_2006\tutorial\
    How can I actually display the file I want to open, or save some text I've written?
    I would appreciate any help, thanks.

  • HOW TO OPEN AND SAVE FILES TO/FOR MS-WORD 2007 .docx format

    MS-Office 2007 will open .docx files as well as .doc files. Apple's Pages '08 can OPEN MS Word 2007 documents with the new file format ".docx". Pages '08 can not save as ".docx" files, just ".doc" files, but since MS Office 2007 can open these ".doc" without a problem, you should be covered.
    Here is how.
    To open: Just double click the file and Apple's Pages '08 will import the file and open it for you to use and modify.
    To save and use at your work or school's Windows MS Word 2007: When you are done and ready to save the file, go to FILE in the menu bar in Pages '08 and select EXPORT. Then pick the icon DOC WORD and click NEXT. Then in the SAVE AS box, give it a name and tell where you want to save your file to. Click EXPORT. Export is like Save, as it will now save the file where you told it to save it to. Remember you can use the same name, or give it a new name. Thats it. EASY.
    It will save the file in a Windows Word format of ".doc" that MS Word 2007 can open and use.
    Hope this helps people.
    -Apple //GS

    Why yes. How did you know that I saw the way, the truth and the light?
    I just had so many people ask me how to do this, that I thought I might share it with as many people as I could and help the masses To bad that Apple just did not have it as a simple "Save As:" Maybe in the next update.
    -Apple //GS

  • Popup with open and save file option

    Hi,
    I have created a button on my page name as "Export File" and created a process and called on "EXPORT FILE" button. I am using utl file in this procedure and i want to download this file and file will be .ics file using for calendar.
    My page process code is
    begin
    pro_create_ical(:P6_START_DATE,:P6_END_DATE);
    end;when i click on export file button it should raise a popup with open and save file option.
    How i can do this?
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 25, 2013 1:59 AM
    Edited by: Vedant on Jan 25, 2013 2:00 AM
    Edited by: Vedant on Jan 25, 2013 3:49 AM

    Shiv,
    Have you installed any new Software/Spyware/Virus Scanner etc.Check it out.It might have caused the issue for last 5 days.
    This issue is fixed in Latest Support Package Versions.
    Which Version of Support Package you are using?
    If EP6 <SP19 you will face this issue.
    Just upgrade it to EP6, Support Pack-19,this will be resolved.
    Upgrade of Support Pack wont take much time.you can get the document under http://service.sap.com/instguides
    Hope it helps
    Regards,
    Karthick Eswaran
    *Reward Points for helpful answers.

  • How to open a .JAR file on the Z30

    Hi,
    Would anyine know how to open a .JAR file on the Z30?
    I get a message saying "Unable to open" when I click on the .jar file i want to open in my blackberry & install.
    Cheers
    Mario

    JAR files are for older java phones, they dont work on BB10
    maybe you should look into using SNAP to get some apps yoru looking for
    http://supportforums.blackberry.com/t5/Downloaded-Applications-for/You-Upgraded-to-OS-10-2-1-and-wan...
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • How to open and save pictures from 1 folder at the same time?

    Is there a way to open and save pictures from 1 folder at the same time?
    I'm creating a vi that resizes the picture but I want to do it with 1 folder at a time... Is this possible?
    greetings!

    Hi Kway,
    Here you are. I wrote a file a customer times ago & It did what you want!
    Just see the attachements and keep me inform.
    Regards,
    Julien Roland - District Sales Manager
    NI Belgium - Technical Support
    Don't forget to rate a good answer
    Attachments:
    Test existing Files.vi ‏23 KB
    Delete files from array of files (SubVI).vi ‏16 KB

  • How to open a save file dialog box in form

    hi
    all
    I have prob in form desing , i have open the save file dialog box , how to open a save dialog box
    and path of the select file to save in disk
    help
    thx

    hi
    user this query when-button-pressed trigger
    :txtfile := GET_FILE_NAME(directory_name =>'d:\ali_raza\backup\', file_filter=> 'DMP Files (*.dmp)|*.dmp|');
    Rizwan

  • PS CC - Performance, open and save files

    Hi guys,
    I am working on multi-gigabyte files 4-10gb, but say a 5gb file takes me approx 75 seconds to open... it only use 4 core's and 10gb of ram.
    Saving is so sloow - same size files, now I haven't timed it but it takes time... IMHO it takes too much time considering the hardware.
    system contains 20 SSD's
    8x Samsung 830 Raid-0 for startup disk (Areca 1882ix-24 4GB cache)
    6x Intel 520 Scratch disk in Raid-0 IBM M1015 controller
    6x Intel 520 storage disk in Raid-0 IBM M1015 controller
    I have played with various configurations
    48GB of ram
    2x XEON X5650 at stock speed 2.66Ghz - but it can go to 4.2Ghz
    Windows 7 x64
    am I expecting too much?
    thanks
    Henrik

    Hi fbnmir or who ever can answer my question,
    My problem is similar to the code you wrote. I'm trying to make (or rather complete a half done) editor for text files. For opening and saving files I have so far:
    public void actionPerformed(ActionEvent ae){
    FileDialog filedialog;
    final SearchDialog searchDialog;
    String arg = (String)ae.getActionCommand();
    // the Open ... case
    if(arg.equals(Editor.fileLabels[0])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[0] +
                        " has been selected");
    filedialog = new FileDialog(editor, "Open File Dialog", FileDialog.LOAD);
    filedialog.show();
    if(Editor.VERBOSE){  
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Open file = " + filedialog.getFile());
    System.err.println("Open directory = " + filedialog.getDirectory());
    //the Save ... case
    if(arg.equals(Editor.fileLabels[1])){ 
    if(Editor.VERBOSE)
    System.err.println(Editor.fileLabels[1] + " has been selected");
    filedialog = new FileDialog(editor, "Save File Dialog", FileDialog.SAVE);
    filedialog.show();
    if(Editor.VERBOSE){ 
    System.err.println("Exited filedialog.setVisible(true);");
    System.err.println("Save file = " + filedialog.getFile());
    System.err.println("Save directory = " + filedialog.getDirectory());
    These are two components of a MenuHandler class. The problem with this code is that in the text editor window, even if the Open button is pressed the file I want to open isn't displayed. Although the System.err (I think that's what it is called) says:
    Open ... has been selected
    Exited filedialog.setVisible(true);
    Open file = tutorial_01.rtf
    Open directory = C:\dhruba\epgy_2006\tutorial\
    Save ... has been selected
    Exited filedialog.setVisible(true);
    Save file = test.txt
    Save directory = C:\dhruba\epgy_2006\tutorial\
    How can I actually display the file I want to open, or save some text I've written?
    I would appreciate any help, thanks.

  • How can I open and copy files on the win side from the  mac side?

    I am working on the mac side and I need to be able to copy files from the mac side that I create over to the win side.  I can open and view win files when I am booted to Snow Leopard, but I cant copy files to the win side.  I think Macdrive does the opposite.
    Any ideas?
    thanks,
    C

    to write to Windows NTFS you need 3rd party.
    You have read only access to HFS from Windows.
    MacDrive8 works in Windows to add write to HFS as does Paragon. Paragon has what I have come to see as the best NTFS driver for OS X, and they have a separate HFS8 for Windows similar to MacDrive8.
    Maybe you want to run Windows as a client OS using Parallels instead?

  • How to open and XML file?

    Does anyone have a way on Mac to open an XML file for viewing. This can be done with WIN Excel and XML toolkit but doesn't exist for Mac Excel in Office 2008. I can open with TextEdit but would like to see the info with headers and cells without all the XML coding. Numbers 09 can't open it at all.

    Numbers uses XML to build the description of the documents but it's not an XML editor.
    A simple search in Google with the intricate key string xml editor AND mac return numerous interesting links.
    Yvan KOENIG (VALLAURIS, France) vendredi 9 octobre 2009 11:33:27

  • Illustrator CC is taking a very long time to open and save files.

    I am using a Mac with the Mavericks OS. Illustrator can take up to FIVE MINUTES to open or save a file. It is becoming a waste of time as I have to work on multiple projects a day. I read about "Adobe Drive" but have not found this option on the version of Illustrator that I have.
    Please help!

    Any update?
    I found this discussion: http://forums.adobe.com/message/5839180 but have been unable to locate Adobe Drive on my system.
    I have followed the above suggestions with no avail. I have only been opening files from my desktop. This issue is only with Illustrator, Photoshop works fine.
    I ran a script yesterday that opens up eps files and saves them as a png, and what normally takes around 30 seconds took almost 45 minutes. I need to solve this problem asap.
    Would uninstalling and reinstalling the CC suite be of any benifit?

  • Slow to open and save files

    My Macbook Pro with Mac OS X 10.7.4 has been real slow lately in opening files, saving documents, opening webpages.  Any suggestions on ways to speed things up?  I often have MS Excel and Word and Outlook open so not sure if that is the problem.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box. Don't use the Safari-only Guest login created by Find My Mac.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Help with how to read and write files to the applets server

    I am writing a form that requires some data to be written serverside(not on the host machine) and I also need to be able to read from those same files.
    Can anyone provide any help?
    I looked into signing but it seems, to me, that signing is for when you are going to be modifying files on the host...

    brianb7590 wrote:
    Would I use that to refer to the file like I would with a regular application?Nope. It's pretty complicated. You've got to set something up on the server to accept requests, get all the data and then save files somewhere and on the client side you've got to make the connection and send the data.
    Edited by: tjacobs01 on Apr 13, 2009 5:49 PM

  • How to open a dotm file on the ipad

    Dear all,
    I need to open a dotm-file (MS Word) on the ipad. Has anyone an idea how to do this? Converting the file to doc doesn't work because I need to have the macros in this file.
    THX for every support
    Michael

    JAR files are for older java phones, they dont work on BB10
    maybe you should look into using SNAP to get some apps yoru looking for
    http://supportforums.blackberry.com/t5/Downloaded-Applications-for/You-Upgraded-to-OS-10-2-1-and-wan...
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • How to fetch and save file in common server using FTP in SAP

    Dear All,
    My requirement is to fetch a image and save an image in a common server through SAP .
    I think there is some concept of doing the same using FTP.
    Please put some light on this issue.
    REgards,
    Amruta

    Hi,
    Below are the FM's use to FTP.
    FTP_CONNECT                    Connect to FTP server
    FTP_COMMAND                    Execute FTP Command
    FTP_DISCONNECT                 Disconnect from FTP server
    You can search SDN for more details on each of the FM's.
    Hope this helps
    Regards
    Shiva

Maybe you are looking for