JFileChooser and FilePermission write

Hi,
I use a JFileChooser in a swing application like this :
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
if (fileChooser.showOpenDialog(MainJWS.this)== JFileChooser.APPROVE_OPTION) {
dir2Name = fileChooser.getSelectedFile().getPath();
I want the application to only get rights on FilePermission to read. So I change my policy file like this :
grant {
permission java.io.FilePermission "<<ALL FILES>>", "read";
So when the appli runs, there is a PermissionException on write right. Is there any way to use the JFileChooser only on a read mode ?
thanks.

Thanks, I saw it.
Maybe there 's another way, with FileDialog ? Or with JFileChooser and FileSystemView ?
any idea ?

Similar Messages

  • Hello! The question is this. In London, took the Iphone 5 as sim free, flew to Moscow put Simcoe, and he writes me that is locked to the operator O2. Can anyone encountered this problem? What to do? How to remove the Unlock?

    Hello! The question is this. In London, took the Iphone 5 as sim free, flew to Moscow put Simcoe, and he writes me that is locked to the operator O2. Can anyone encountered this problem? What to do? How to remove the Unlock?
    <Edited by Host>

    Look at your receipt. Does it say unlocked? It is possible to purchase both locked "sim free" and unlocked iPhones from Apple.
    ONLY the carrier an iPhone is locked to can legitimately unlock it.
    IF your receipt says that it was supposed to be unlocked, and it is not, call AppleCare. They should be able to straighten it out.

  • I have a problem with your app store, always I want to update a new app, I want to know what Schiffer and novelty app! Most of my applications are in English, and they write what the improvement and renewal are written in English, and I do not speak the

    Hi
    I have a problem with your app store, always I want to update a new app, I want to know what Schiffer and novelty app! Most of my applications are in English, and they write what the improvement and renewal are written in English, and I do not speak the language! I try to copy the text, color (gray) is not successful, the variance can it, so we can copy the text and translate?
    I thank you for your help, it can help to humanize

    You are right, but how could i send it to Apple? when the phone company first replaced my iphone they had in stock alots of iphones and they just sent mine back to Apple and gave me a new one, so all i did is to give them my phone, but now how could i sent it to Apple? and i cant send it by myself, and the store wont do that, its a lost for them.. so sending it to Apple wasnt an option from the begining.
    and for the record, i dont think the store where i bought it is an authorized shop.. its just a store who boughts phone's from Apple in a low price and sells it in much more money..

  • Acrobat Reader 9 and Acrobat Writer 7

    Good morning
    I have a nice issue with these 2 adobe products
    We have 2 products installed in our pc: Adobe Reader 9.x and Adobe Writer 7
    We have developped a SAP-Procedure who load a PDF form in wich users can modify some data
    The procedure need Adobe 8.1.x (up) but the presence of Reader 9 and Writer 7 will generate an error loading the form
    IS it possible to unregister the Adobe 7 module loaded in IE and re-load Adobe Reader 9 activex modules?
    Best regards
    Nicola G.

    Thanks for the answer. I've found a little workaround... The only way is
    uninstall Adobe Reader 9.x and re-install SO the program could
    re-register AR components in IE. This because AA7 lock some keys and cannot unregister them manually!

  • Report Painter and Report Writer (URGENT)

    Hi All,
         Please can you send me Step by Step screen shots Configuration document for Report Painter and Report Writer,
    If any body send relavent data i will give reword points,
    Regards,
    TML

    Hi,
    see the below link cfor complete documentaion of report painter.
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    Thanks.

  • Difference between Reaport Painter and Report Writer

    HI All,
    What is the Difference between Report painter and Report Writer
    regards
    JK

    Hi
    Report Painter allows the user to report on data from various applications using graphical report structure which forms the basis for report.
    Report Writer allows the user to report on data from multiple applications using functions such as sets, variables, formulas, cells, key figures and the user can create more complex reports as per clients requirements.

  • Query performance problem - events 2505-read cache and 2510-write cache

    Hi,
    I am experiencing severe performance problems with a query, specifically with events 2505 (Read Cache) and 2510 (Write Cache) which went up to 11000 seconds on some executions. Data Manager (400 s), OLAP data selection (90 s) and OLAP user exit (250 s) are other the other event with noticeable times. All other events are very quick.
    The query settings (RSRT) are
    persistent cache across each app server -> cluster table,
    update cache in delta process is checked ->group on infoprovider type
    use cache despite virtual characteristics/key figs checked (one info-cube has1 virtual key figure which should have a static result for a day)
    =>Do you know how I can get more details than what's in 0TCT_C02 to break down the read and write cache events time or do you have any recommandation?
    I have checked and no dataloads were in progres on the info-providers and no master data loads (change run). Overall system performance was acceptable for other queries.
    Thanks

    Hi,
    Looks like you're using BDB, not BDB JE, and this is the BDB JE forum. Could you please repost here?:
    Berkeley DB
    Thanks,
    mark

  • Data source for deposit advice xml and check writer xml

    Could someone please tell me where I can find the data source for the Deposit Advice XML and Check Writer XML programs. Since these executables are now a spawned process (PYUGEN), I don't know how to get to the data source. I was able before to look at the queries in PAYUSPST.rdf and PAYUSCHK.rdf. Where are these queries located now? Any help is appreaciated.

    Hi All,
    I applyied the patch 6399100 and i got the seeded Check Writer (XML) and Deposit Advice (XML) programs.Im able to run the Check Writer (XML) with Parameter (Check Style :Seeded Archive Check Writer Template ) but where as the im unable to run the Deposit Advice (XML) due to Error msg: "No enties found for list of vales"for the 'Check Style' Parameter.
    And for the above (only for Deposit Advice) i am not able to ecexute the SQL script given in the Doc ID : 459306.1 due to the error msg : cannot insert NULL into ("HR"."PAY_REPORT_CATEGORIES"."REPORT_GROUP_ID") if i see query the select * from apps.pay_report_categories where short_name like 'ARCHIVE%' there is no record exixts for ARCHIVE_DEPOSIT....
    for this we required any other patch/setups.
    And is the "Third Pary Check" will support XML Publisher ??
    Any respose will be greatly appriciated.
    Thanks,
    Madhu
    Message was edited by:
    user589951

  • Diff between print writer and outputstream writer

    hi!
    what is the difference in giving print writer and outputstream writer in servlet?
    thanx

    OutputStreamWrite is a bridge from character stream to byte stream,
    PrintWriter print formatted representations of objects to a text-output stream

  • JFileChooser and FileFilters

    I have the following problem:;
    I have a JFileChooser and I attached a FileFilter to it, which only allows files with the extension *.in and *.inx. Everything works well - only files with these extensions are shown in the Dialog.
    But as a user I expect, that it is not a fault if I only type in the name of the file, because I expect the programme to add the extension automatically. For example in an OpenDialog, the user sees the file test.inx and the types in "test", because he/she thinks that the extension will be added.
    This is not the case...and which is even worse, the call of fileChooser.getSelectedFiles() will return an empty array. Hence there is no possibility for the programme to add the file extension.....
    How can solve this problem?? What is my mistake?? I cannot image that Swing is not able to do this, because this common FileDialog behaviour....
    I thank everybody who tries to help me...

    The quick and dirty workaround would be to create a "Save" dialog (setDialogType method), set the Button texts to whatever you want, the same for title. When the dialog returns, you can check the file (getSelectedFile()), and if it does not exist, try the same name with the extension(s).

  • Why i cannot connect my dvd writer and cd writer using ide2???

    why i cannot connect my dvd writer and cd writer using ide2???
    can anyone help?

    Why is it that i cannot connect both the harddisk to IDE1 and both writers to IDE2 or IDE3?
    Currently i am only connecting my Samsung 80G and Sony DRU810A to IDE1.
    Can anyone help?
    PowerLogic 450W
    Intel Pentium 4 2.8Ghz FSB 533/775
    512Mhz Kingston PC - 4300 DDR2 533 CL4
    MSI 915P Neo2 FR
    Samsung 80G 7200rpm 2MB
    Maxtor 40G 7200rpm 2MB
    Sony DRU810A 16xDVD+-R (8xDL)
    Iomega cdrw 40x12x40

  • Search record combine with read only and read/write record

    can the search record display read only and read write only record together ?

    Maybe your Mac-B user account has the same (short) user name
    as your Mac-A user account. Matching user names or short user names
    could make the Mac-B account able to Read & Write to your shared folder.
    Because I think you can log in with short user names to a server
    as well. I guess passwords should be matching as well,
    and perhaps the user ID's (System Preferences -> Accounts
    -> right-click on user) also?
    Cheers,
    Vincent Verheyen.

  • JFilechooser and droptarget

    Hi,
    I've managed to be able to drop files into a jfilechooser (using droptarget), but the drop somehow targets the wrong part of jfilechooser
    new DropTarget( jFileChooser, this);
    When I try the above, the drop only works on the scrollbar of jFileChooser (I can drop stuff on the scrollbar, but not in the file window). Do I need to target a sub-component of jFileChooser with DropTarget, if so how?
    Cheers,
    Daniel

    Don't know if it is the best way, but since I couldn't tell which sub-component of JFilechooser to use, I iterated through the JFilechooser and attached drop targets to all components within. Looks like it solved the problem.

  • I put more wrong passcodes and then write "Iphone is disabled | Connect to iTunes". When i connect to iTunes, appear a error where write that I can't connect iPhone to iTunes because must to put a password on iPhone . HEEEEELP !

    I put more wrong passcodes and then write "Iphone is disabled | Connect to iTunes". When i connect to iTunes, appear a error where write that I can't connect iPhone to iTunes because must to put a password on iPhone ( but I can't connect iPhone to iTunes because is blocked) HELP me PLEASE ! And give you more details if you want .
    Sorry for my english but I am from Romania and I don't know very good .

    Forgot an iPhone Passcode? How to reset the iPhone passcode
    iPhone and iPod touch- Wrong passcode results in red disabled screen
    Please get the iPhone iOS 4 user guide.

  • Using jFileChooser and FileFilter

    I am using a jFileChooser and want to add a file filter to only show .jpg files. I tried using...
    FileFilter filter = new FileFilter();
    filter.addExtension("jpg");
    filter.setDescription("JPG Images");
    fileChooser.setFileFilter(filter);
    fileChooser.showSaveDialog(jPanel1)I get an error saying FileFilter is an abstract. I was wondering how I can successfully filter a jFileChooser. Also, what imports libraries do I need to perform the task. I have looked at sample code and it seems they do their own classes, I want to know how to handle this task using the libraries java provides.

    Here's another way to do it, using an anon. inner
    class:
    JFileChooser chooser = new JFileChooser();
    chooser.setFileFilter(new FileFilter() {
    public String getDescription() { return "Image
    files"; }
    public boolean accept(File f) {
    if(f.isDirectory()) return true;
    if(f.getName().endsWith(".jpg")) return true;
    if(f.getName().endsWith(".png")) return true;
    return false;
    /code]
    I find myself using a lot of anon. inner classes in
    Swing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Blend tool to objects with no fill (transparency)

    Is it possible to create a blend using the blend tool with one of the objects to be blended being transparent (having no fill or outline)? If not, could someone please suggest an alternate solution? I know I can do something somewhat similar with gra

  • IWeb published old photo names... will not update

    I am having a problem with the photo pages. When I first built a photo page I used images whose file names were too long. When iWeb published the files the names became corrupted and would not display. I can't get iWeb to forget the original file nam

  • How to Reverse Internal Orders

    Hi, We had a incorrect IO postings to wrong company code and the costs been posted to it, now i need to reverse it and post to correct company code, Pl let me know how can i rosolve this, inorder to reverse the entries which transaction do i need to

  • Reg : SDCCN / USMM tcode abap run time error

    Dear Friends, Runtime Errors : DBIF_RSQL_SQL_ERROR Exception : CX_SY_OPEN_SQL_DB When I run a T.Code SDCCN and USMM, got abap run time error "SQL error in the database when accessing a table" that errors are below. Internal Call code is ..........[RS

  • 2 hard drive icons on desktop?

    I am new to mac computers and have just inherited an old blue iMac which I already have updated to system OSX However one thing I don't understand is that I have 2 hard drive icons on my desktop with different names, one contains the OS9 and OSX - th