How do you set restriction on the files you can open?

Hi!
How can I set a restriction on the JFileChooser dialog? I only want to be able to open .dat files. Does anybody know how?

Hello
To filter out files you need to create a subclass of FileFilter and perhaps a subclass of FileView that will store an icon for the file type .dat.
Take a look here http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html#filters
Hope this helps
David

Similar Messages

  • How do I move a movie I have synced from iTunes into the "Movies" tab of the Video App? I need to access a slideshow I made in IMovies and may not have WiFi. I did it once, but can't figure out how to do it again! The file is an m4v. Thank you!

    How do I move a movie I have synced from iTunes into the "Movies" tab of the Video App? I need to access a slideshow I made in IMovies and may not have WiFi. I did it once, but can't figure out how to do it again! The file is an m4v. Thank you!

    Im just guessing but it seems like you would have to get your movie into the correct folder on a computer then use iTunes to sync it to your iPad. If you've synced to a computer and have movies then on your computer should be a folder with the movie in it. You could export your iMovie to something like Dropbox then download from Dropbox to the folder you think it needs to be in the sync your iPad again. Again this is just a guess. Others may have a better answer.

  • Changing the setting name in the file name

    How do I change en masse the file name in a compressor batch?. Say, instead of having the default codec name, IE "Apple Pro Res," I could choose something unique for myself.
    Or how do I just get rid of it the setting tag without using a custom destination?
    Studio X wrote:
    "You can permanently solve the issue by making a simple change in the Preset.
    Click on your preset to load it into the Inspector in Compressor
    Click on the "actions" icon underneath the Names & Descriptions fields.
    Go down to Default Destinations and set it to " Source w:o additional names"
    Save the preset.
    Now every time you apply the preset you'll get the file placed back into the source folder without the additional info in the file name.
    One caveat - make sure that your new file name does not exactly match (including the suffix) the original file. If it does, you'll overwrite the original.
    x"
    However I did not find this "w:o additional names" option.
    I am running Compressor V 3.5.3 - is that the reason?
    Cheers,
    Edwin

    Could be a version thing.
    In 3.5.3 it works like this:
    You first need to create a new Destination:
    In compressor select the Destination Tab (1), then press the PLUS sign (2).
    Select Local (if it's going to be on your computer) or Remote (if it's on a network)
    Compressor will ask you which folder. In this example I created a new folder, called 'testingfolder' (3).
    In the Inspector then you can choose the naming options. Which is now right by default (4). So you don't have to alter that.
    Now do all steps as Studio X described, but a slightly different:
    "You can permanently solve the issue by making a simple change in the Preset.
    Click on your preset to load it into the Inspector in Compressor
    Click on the "actions" icon underneath the Names & Descriptions fields.
    Go down to Default Destinations and set it to " Source w:o additional names"
    ...set it to 'testingfolder'
    Save the preset.
    Now every time you apply the preset you'll get the file placed back into the source folder without the additional info in the file name.
    One caveat - make sure that your new file name does not exactly match (including the suffix) the original file. If it does, you'll overwrite the original.
    [The latter is only true if the destination folder is the same as the source folder, which I'd strongly advise not to do.]
    Rienk

  • The vendor account is not associated with the file you are trying to open.Please try again.

    Please help me to understand what is the problem with the set up of the program. I bought an ebook from an internet site to which my IP address was blocked (in country 1). My brother bought it on a computer in country 2  and wanted to download and send me the file so I can open it on my computer. He set up initial download without Adobe ID. Afterwards he downloaded the pdf and send it to me. I tried to upload it  with my ADE reader but it didn't work without ID. My brother then deleted afterwards his ADE and installed it again, downloaded the ebook again but this time setting up an ID. He transferred me the file ,I used the same ID  but then the following message appeared "The vendor account is not associated with the file you are trying to open. Please try again." . Can this be fixed somehow? I cannot open the URLLinks even as there is no connection from my IP , but I have the pdf file ( ebook) but I don't know how to set up the program.

    Sorry Everyone this error message appeared in Digital Editions 4 used on a windows 8 laptop.  Thanks Chris

  • How I put photos / images at facebook page? The files do not open.

    How I put photos / images at facebook page? The files do not open.

    The crash happens on setting up the audio hardware. Either you have a broken driver or your preferences is damaged. You can try deleting the MainStage preferences.

  • How do I upload and attach the file to Service Request

    [This thread was migrated from the On Demand Developer Forum in the old Siebel Community]
    drangineni
    New Contributor
    Hi,
    I am trying to upload a file and add it to a Service object as an
    attachement. I greatly appreciate if you could provide any code or
    sample...
    Thanks.
    Daya
    Product: CRM OnDemand
    10-21-2006 10:58 AM
    Re: How do I upload and attach the file to Service Request...
    BigSlick
    Valued Contributor
    On Demand doesn't support adding attachments via web services. One
    solution I've seen is depending on the scenario is to create a web link
    field on an object that's based on a custom text field. Your web service
    can populate that custom field and the web link can generate a dynamic
    link to the file in On Demand's UI. However, this depends on where the
    attachment is located and if the user needs some sort of firewall access.
    Hope this helps
    -BigSlick
    10-23-2006 11:43 AM
    ==============================================================================
    Click on the board or message subject at the top to return.

    Yes this still holds ture.
    Bardo

  • Is there a PS setting where it can read my Canon Mark 3 5D's monochrome setting so that the files will also appear in monochrome instead of colour? Or do I have to change from RAW each time to Monochrome within PS (even if I have set up for Monochrome in

    Is there a PS setting where it can read my Canon Mark 3 5D's monochrome setting so that the files will also appear in the same monochrome structure (instead of appearing in colour as it is now when i open in PS, not even monochrome)? Or do I have to change from RAW each time to Monochrome within PS (even if I have set up for Monochrome in my 5D)?
    1. Basically I am taking photos with a monochrome setting with my 5D and the screen shows monochrome.
    2. when i import this onto my computer and open with PS, it opens in colour.
    3. when I change this to Monochrome in PS. (It cannot read my monochrome setting with my preference of the greyscale mix when I viewed it on my 5D)
    4. my question is: is there a way so that PS can read the monochrome setting from my 5D and display the same monochrome setting as my 5D instead of a different one from PS.
    Lily

    you need camera raw 6.7 or better.
    i don't know what version of ps you have so i can't say if it can be updated to use that, but update anyway.
    pre cc updates:  http://www.adobe.com/downloads/updates/
    cc updates:  http://prodesigntools.com/adobe-cc-updates-direct-links-windows.html
    cc 2104 updates:  http://prodesigntools.com/adobe-cc-2014-updates-links-windows.html
    if you can't update your cr sufficiently, use the dng converter. DNG Converters:
    Win
    Mac

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

  • Error while creating sites on entire site collection - the file you are attempting to save or retrieved has been blocked from this web site by server administrator

    Hi,
    I am trying to create a new sub site. Everytime I try to create the site I get this error:
    the file you are attempting to save or retrieved has been blocked from this web site by server administrator
    This applies to almost all site templates except the "blank site" template. I am logged in as System Administrator.

    Issue resolved!
    Don't know how but somehow, xml was added to the Blocked file types. Removing the entry did the trick.

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

  • I followed your help directions on "Corrupt extension files" under "Unable to install add-ons", foolishly deleting the files you told me to. Now firefox won't open. I tried reinstalling firefox but it still won't open. Now what do I do?

    I was trying to install the SEOQuake add on. After clicking install Firefox would hang up saying the script had timed out and asking if I want to stop it or continue. Didn't matter which option I chose nothing would happen. The only way to stop it was to close Firefox and restart. Tried restarting the computer. Still wouldn't install. Tried installing the Outwit add on and got the same error leading me to conclude it was a problem with Firefox, not the add on. I found this help page <http://support.mozilla.com/en-US/kb/Unable+to+install+add-ons?s=addons+won't+install&as=s> and did everything it told me to. Finally at the end I got to "Corrupt extension files". I foolishly deleted the files you told me to and now Firefox won't even start! I tried reinstalling Firefox and it still won't start. Tried restarting the computer. I have no idea how to get back to where I was let alone install the add ons I wanted to install. Please help. At this point I'd just be happy to be able to get Firefox working.

    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    Create a new profile as a test to check if your current profile is causing the problems.<br />
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)<br />
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • An error occurred while opening the file, you can not open this file because it does not page???

    Dear all,
    i am test the report to show "No Data Found"  world, but, when i preview to PDF, i got  the message :An error occurred while opening the file, you can not open this file because it does not page.
    i try to load the other xml file that have data, and report work,no error.
    i don't know where is the problem, so i need some help....
    Thanks in advance for your response.
    my rtf report:
    <?call:header?>
    <?if:count(PLAN_CODE)>0?>
    <?for-each@section:G_PLAN_CODE?>
    <?template:Header?>
      <?for-each:G_PURPOSE?>
      <?end for-each?>
    <?end template?>
      <?for-each:G_PLAN_SUBSQL2?>
      <?end for-each?>
    <?end for-each?>
    <?end if?>
    <?if:count(PLAN_CODE)=0?>
    ====================No Data Found ===================
    <?end if?>
    about xml:
    if no data query back:
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <NARLGLR005>
      <LIST_G_PLAN_CODE></LIST_G_PLAN_CODE>
      <CF_START_DATE>102.3</CF_START_DATE>
      <CF_END_DATE>102.3</CF_END_DATE>
      <CF_TITLE_NAME>Company</CF_TITLE_NAME>
      <CF_OU_NAME>IT Department</CF_OU_NAME>
      <CF_SOURCE_CODE>N/A</CF_SOURCE_CODE>
      <CF_PRINT_DATE>102.11.18  15:48:10</CF_PRINT_DATE>
    </NARLGLR005>
    if have data:
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <NARLGLR005>
      <LIST_G_PLAN_CODE>
        <G_PLAN_CODE>
          <PLAN_CODE>03101C3003</PLAN_CODE>
          <PLAN_NAME>03101C3003_test</PLAN_NAME>
          <PLAN_EM>John</PLAN_EM>
          <PLAN_START_DATE>101.09.01</PLAN_START_DATE>
          <PLAN_END_DATE>102.08.31</PLAN_END_DATE>
          <PLAN_HOSTS>abc_super</PLAN_HOSTS>
          <LIST_G_PURPOSE>
            <G_PURPOSE>
              <PURPOSE_CODE>11600000</PURPOSE_CODE>
              <PURPOSE_NAME>Pre-Pay</PURPOSE_NAME>
              <LIST_G_PURPOSE_CODE>
                <G_PURPOSE_CODE>
                  <BUDGET_AMOUNT>0</BUDGET_AMOUNT>
                  <REAL_BUDGET_AMOUNT>0</REAL_BUDGET_AMOUNT>
                  <TEMP_RECEIPT_AMOUNT>0</TEMP_RECEIPT_AMOUNT>
                  <REAL_PAY_AMOUNT>0</REAL_PAY_AMOUNT>
                  <TEMP_PAY_AMOUNT>-83006</TEMP_PAY_AMOUNT>
                  <TEMP_PAY_FINAL_AMOUNT>83006</TEMP_PAY_FINAL_AMOUNT>
                  <TOTAL_AMOUNT>83006</TOTAL_AMOUNT>
                </G_PURPOSE_CODE>          
              </LIST_G_PURPOSE_CODE>
              <CS_BUDGET_AMOUNT>0</CS_BUDGET_AMOUNT>
              <CS_REAL_BUDGET_AMOUNT>0</CS_REAL_BUDGET_AMOUNT>
              <CS_TEMP_RECEIPT_AMOUNT>0</CS_TEMP_RECEIPT_AMOUNT>
              <CS_REAL_PAY_AMOUNT>0</CS_REAL_PAY_AMOUNT>
              <CS_TEMP_PAY_AMOUNT>0</CS_TEMP_PAY_AMOUNT>
              <CS_TEMP_PAY_FINAL_AMOUNT>0</CS_TEMP_PAY_FINAL_AMOUNT>
              <CS_TOTAL_AMOUNT>0</CS_TOTAL_AMOUNT>
            </G_PURPOSE>      
          </LIST_G_PURPOSE>
          <LIST_G_PLAN_SUBSQL2>
            <G_PLAN_SUBSQL2>
              <GL_DATE>31-07-12</GL_DATE>
              <NARL_DOC_NUMBER>0310107311004</NARL_DOC_NUMBER>
              <AP_UNAPP></AP_UNAPP>
              <PLAN_NAME1>03101C3003_101-102</PLAN_NAME1>
              <PLAN_CODE1>03101C3003</PLAN_CODE1>
              <PLAN_EM1>Elly</PLAN_EM1>
              <PLAN_START_DATE1>2012/09/01 00:00:00</PLAN_START_DATE1>
              <PLAN_END_DATE1>2013/08/31 00:00:00</PLAN_END_DATE1>
              <PLAN_HOSTS1>KIC-Supp</PLAN_HOSTS1>
              <REAL_RECEIPT_AMOUNT>0</REAL_RECEIPT_AMOUNT>
              <DESCRIPTION>101 year</DESCRIPTION>
              <CF_GL_DATE>101.7.31</CF_GL_DATE>
            </G_PLAN_SUBSQL2>
          </LIST_G_PLAN_SUBSQL2>   
          <CF_START_DATE1>99.1</CF_START_DATE1>
          <CF_END_DATE1>102.11</CF_END_DATE1>
          <CF_TITLE_NAME1>TCS Company</CF_TITLE_NAME1>
          <CF_OU_NAME1>IT Department</CF_OU_NAME1>
          <CF_SOURCE_CODE1>plan</CF_SOURCE_CODE1>
          <CF_PRINT_DATE1>102.11.19  17:12:19</CF_PRINT_DATE1>
          <CS_T_BUDGET_AMOUNT>517524</CS_T_BUDGET_AMOUNT>
          <CS_T_REAL_BUDGET_AMOUNT>517524</CS_T_REAL_BUDGET_AMOUNT>
          <CS_T_TEMP_RECEIPT_AMOUNT>289294</CS_T_TEMP_RECEIPT_AMOUNT>
          <CS_T_REAL_PAY_AMOUNT>289294</CS_T_REAL_PAY_AMOUNT>
          <CS_T_TEMP_PAY_AMOUNT>0</CS_T_TEMP_PAY_AMOUNT>
          <CS_T_TEMP_PAY_FINAL_AMOUNT>0</CS_T_TEMP_PAY_FINAL_AMOUNT>
          <CS_T_TOTAL_AMOUNT>228230</CS_T_TOTAL_AMOUNT>
          <CS_REAL_RECEIPT_AMOUNT>289294</CS_REAL_RECEIPT_AMOUNT>
        </G_PLAN_CODE>
      </LIST_G_PLAN_CODE>
      <CF_START_DATE>99.1</CF_START_DATE>
      <CF_END_DATE>102.11</CF_END_DATE>
      <CF_TITLE_NAME>Company</CF_TITLE_NAME>
      <CF_OU_NAME>IT Department</CF_OU_NAME>
      <CF_SOURCE_CODE>N/A</CF_SOURCE_CODE>
      <CF_PRINT_DATE>102.11.18  15:48:10</CF_PRINT_DATE>
    </NARLGLR005>

    Hi,
    You mentioned you tried some steps but I'm not sure what they are, you may try my suggestion to resolve this issue, follow these steps:
    Click Start, right-click Computer, click
    Properties, and then click Advanced system settings.
    On the Advanced tab, click Environment Variables.
    Locate and select the __COMPAT_LAYER variable, and then click Edit.
    Set the value of the __COMPAT_LAYER variable to EnableThemes. Or, delete the __COMPAT_LAYER variable.
    If the issue persists, we can troubleshoot this problem in Clean Boot to determine whether background programs are interfering with PowerPoint:
    http://support.microsoft.com/kb/929135
    Regards,
    Melon Chen
    TechNet Community Support

  • How do i get the path of the file selected for opening in JFileChooser

    hi
    I need to get the path of the file selected for opening or saving in the JFileChooser dialog box.Is there any method available.if not how do i get that?
    Thanks and Regards
    Saminathan.

    don't know if its the best/only way, but you could use the getSelectedFile() method in JFileChooser which returns a file and then use the getAbsolutePath() file method

  • When I send messages off-line, they enter in the addressed mailbox with the date and hour which I've clicked "Send later". How could I set up to the real time?

    When I send messages off-line, they enter in the addressed mailbox with the date and hour which I've clicked “Send later”. How could I set up to the real time?

    What you say about Send Later timestamp is correct.
    When you click Send or Send Later a time is set regardless of when you actually sent the Send Later email.
    Please voice your vote at this link:
    https://bugzilla.mozilla.org/show_bug.cgi?id=560901
    You will need to logon/register.

  • 9600t in windows. how do i set it to the 9600 gt card how do i get the best

    9600t in windows. how do i set it to the 9600 gt card how do i get the best preformace. i mean in osx you have to switch between the to by logging out. how do i get the best graphics preformance in windows with this card and how do i tune it on in windows

    oh really nice i had no idea. Do i have to loook for a firmware update or anything of that nature..

Maybe you are looking for