Opening a file with custom FileDialog. (VERY URGENT)

hi everybody,
I have a problem and stuck. I have developed a MDI application that provides all function like open saved files, create new, edit and lots of other. It only opens, save ,edit etc the graphical diagrams inside JInternalFrames. I have an icon on my desktop when clicked opens this Application. Just like Editplus, Word or some other application when you click on the icon it opens that. Same way I have created such functionality.
Now instead of this I have created a custom FileDialogfrom which the user selects this application and is opened. Now I have small icon for this FileDialog on the desktop when opened gives the interface to select the files to be opened. My FileDialog just looks like the FileDialog but some more functionality and more components like JComboBox, Jlist, JtextField, JButtons etc. in it and have removed some of them. I am extending JDialog. But now my probelm is when you select a file and click open, it should open the selected file. How can I achive this functionality in my custom FileDialog as I am not extending FileDialog and as it is built in the FileDialog. How can I open the files with any extension in it's related application e.g .doc files to be opened in MicrosoftWord, .txt to be opened in notepad, .c or .cpp in Visual Studio C++ etc.
How can I put this kind of functionality in my custom FileDialog. It's really important for me please any comments will help me alot. Thanks for the help

Hello,
I think you can write :
Runtime.getRuntime().exec("start.exe " + MyFileDialog.getDirectory() + MyFileDialog.getFile());
So, "start.exe" choose the application (not valid for NT machine), ".getDirectory()" return the PATH and ".getFile()" return the NAME.
Best regards from France
Thierry

Similar Messages

  • Opening a file in custom FileDialog (VERY VERY URGENT)

    hi everybody,
    I have a problem and stuck. I have developed a MDI application that provides all function like open saved files, create new, edit and lots of other. It only opens, save ,edit etc the graphical diagrams inside JInternalFrames. I have an icon on my desktop when clicked opens this Application. Just like Editplus, Word or some other application when you click on the icon it opens that. Same way I have created such functionality.
    Now instead of this I have created a custom FileDialogfrom which the user selects this application and is opened. Now I have small icon for this FileDialog on the desktop when opened gives the interface to select the files to be opened. My FileDialog just looks like the FileDialog but some more functionality and more components like JComboBox, Jlist, JtextField, JButtons etc. in it and have removed some of them. I am extending JDialog. But now my probelm is when you select a file and click open, it should open the selected file. How can I achive this functionality in my custom FileDialog as I am not extending FileDialog and as it is built in the FileDialog. How can I open the files with any extension in it's related application e.g .doc files to be opened in MicrosoftWord, .txt to be opened in notepad, .c or .cpp in Visual Studio C++ etc.
    How can I put this kind of functionality in my custom FileDialog. It's really important for me please any comments will help me alot. Thanks for the help

    There is more repeated questions like this !
    Make a search in the Forum with title "Custom FileChooser",and I am sure u would get the solution......
    :)

  • Opening a fiel in custom FileDialog (VERY VERY URGENT)

    hi everybody,
    I have a problem and stuck. I have developed a MDI application that provides all function like open saved files, create new, edit and lots of other. It only opens, save ,edit etc the graphical diagrams inside JInternalFrames. I have an icon on my desktop when clicked opens this Application. Just like Editplus, Word or some other application when you click on the icon it opens that. Same way I have created such functionality.
    Now instead of this I have created a custom FileDialogfrom which the user selects this application and is opened. Now I have small icon for this FileDialog on the desktop when opened gives the interface to select the files to be opened. My FileDialog just looks like the FileDialog but some more functionality and more components like JComboBox, Jlist, JtextField, JButtons etc. in it and have removed some of them. I am extending JDialog. But now my probelm is when you select a file and click open, it should open the selected file. How can I achive this functionality in my custom FileDialog as I am not extending FileDialog and as it is built in the FileDialog. How can I open the files with any extension in it's related application e.g .doc files to be opened in MicrosoftWord, .txt to be opened in notepad, .c or .cpp in Visual Studio C++ etc.
    How can I put this kind of functionality in my custom FileDialog. It's really important for me please any comments will help me alot. Thanks for the help

    hi
    for ur problem there might not be a direct solution, i believe so.
    i made out an indirect way for your problem via the Java. so here it is
    i've tried with Windows98 SE only, not sure of other OS's.
    assume a button that has listener like the one below...
    public void actionPerformed(ActionEvent ae) {
         try {
              Runtime r = Runtime.getRuntime();
              Process process = r.exec("start" + " \"" + yourSelectedFilePath + "\"");
              //want to destroy or close the app from here
              /*process.destroy();*/
         } catch(Exception e) {
              System.err.println(e);
    want more detail about what is "start" command, mail me
    if u want the full code to know how i acheived this, reply back
    i'm not sure that this code works with every PC.
    try out.
    regards ma9

  • When I try to open a file with adobe Bridge it will say that the parent application is not active, how can I fix this??

    When I try to open a file with Bridge the following message appears:
    I already re-installed PS CC and I can open the files trough Photoshop CC but not through bridge.Any advice please??

    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Cs4 opens cs3 files with errors

    Here's a big heads up for anyone considering upgrading to cs4 - don't!  I've been working on a cs3 project and decided to upgrade to cs4 for the extras in the 3D toolset.  All the Adobe propoganda implies this can be achieved no problem, as did soemone on telephone tech support.  Perhaps I didn't clearly ask 'can I open my cs3 file in cs4'.  I can BUT the clips are very much 'out of synch.  I'll lick my wounds and go back to finishing in cs3 but don't purchase cs4 if you think you can seamless import your sc3 project.  Because it seems you very much can not!

    Dennis,
    Many thanks.
    Date: Thu, 11 Feb 2010 05:21:44 -0700
    From: [email protected]
    To: [removed]
    Subject: Premiere Pro cs4 opens cs3 files with errors
    Jarrod,
    As I've stated here in this forum, we're trying to transition Adobe technical support to a new organization and providing the best support we can to our customers.  That being said, it is a long and sometimes painful process, which is why I am here on the forums at times to lend some support.  This doesn't help you and you might not even care so...
    Here's a couple of suggestions:
    1. make sure your software is updated (Premiere Pro 4.2.1) by going to help>updates
    2. clear your prefs - http://blogs.adobe.com/genesisproject/2009/11/having_weird_behavior_with_an.html
    3. try importing (ctrl-I) a CS3 project into CS4
    Try these things and let me know how you make out.  Also, it would be very helpful if you told us about your system and the specs.  I've posted about the importance of 64-bit and lots of memory many times.  You can find one link here: http://blogs.adobe.com/genesisproject/2009/03/64_bit_os_and_adobe_products.html
    The future of Premiere Pro is 64-bit only: http://blogs.adobe.com/genesisproject/2009/10/its_official_64bit_is_the_futu.html
    Beyond that if you'd like me to look into your case, please post your case # here or in a private message to me and I'll gladly look at it.
    I sense your frustration and its understandable - give us a chance to help you.
    Dennis
    >

  • How to open a file with the same name?

    Hi, now I practicing making web pages where I put sample codes in one directory and I copy them to edit.
    The probrem is, I couldn't open one file while I'm opening another file with the same name.
    Is it possible to open  a file with the same name in Dreamweaver?

    That could be a very error prone practice.
    May I suggest you take advantage of DW "Snippets" feature instead.
    Simply save any blocks of code you will reuse regularly as snippets,
    and give each one a descriptive name you like.
    Then you can simply place your cursor in code view where you wish the code,
    and click insert on the selected item from the snippet panel.

  • How to open a file with the assosiate program on suse????

    i came to know that we can open a file with assosiated program on windows using "cmd /c start filename".
    and i want the same functionality on suse linux.
    in forums i found that "kfm filename" will do fine on linux.
    i tried it on suse but no use at all.
    i would appretiate the quick response and i would be very thankful
    for the same.
    Thanks alot in advance.

    take a look at java.awt.Desktop in the JDK SE 6 http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html.
    See these two methods:
    - void edit(File file)
    - void open(File file)

  • Problem opening PDF files with adobe

    I cannot get adobe to open my pdf files. Not from internet nor from desktop.
    I downloads fine,. I have installed and reinstalled several times.
    If I try to open it looks like it opens but closes immediately. I tried to open adobe, but nothing. A grey screen and that's it. I cannot access the help button

    Yes, I finally got it working using number 2:-) Thank you very much
    2013/8/1 Pat Willener <[email protected]>
       Re: Problem opening PDF files with adobe  created by Pat Willener<http://forums.adobe.com/people/pwillener>in
    Adobe Reader - View the full discussion<http://forums.adobe.com/message/5557146#5557146

  • Opening a file with FILE_SHARE_DELETE mode (Only on Windows)

    Hi,
    We have an application that imports logs from several 3rd party vendor's applications. Basically what we do is import the logs in real time, i.e we do have a live FileInputstream connection to the log file. Now, when the 3rd party applications that rotate these logs (many of them do when they grow big or scheduled periodically), all unix flavors dont see to have any problem, while the windows does complain that the device or resource is busy and the original application is not allowed to rotate it. When i dug into the native code of windows jvm, i found that the file is not opened in the FILE_SHARE_DELETE mode and only with FILE_SHARE_READ and FILE_SHARE_WRITE modes. When we wrote a separate C++ application the opens a file with FILE_SHARE_DELETE mode, we found that the logs are rotatable.
    Now, how can we instruct the JVM to open a file with FILE_SHARE_DELETE mode? Is there any such implementation already or do i have to come up with another class extending the FileInputStream and use a totally different open method where the file is opened with this mode in the native code?
    Thanks
    Manava

    Hello,
    I think you can write :
    Runtime.getRuntime().exec("start.exe " + MyFileDialog.getDirectory() + MyFileDialog.getFile());
    So, "start.exe" choose the application (not valid for NT machine), ".getDirectory()" return the PATH and ".getFile()" return the NAME.
    Best regards from France
    Thierry

  • Can't open a file with spaces on the filename.

    Lets say I have a file:
    /home/orv/Open - Me - Please.txt
    When I double click to open that file with any program, the result is something like this:
    "Unable to find /home/orv/Open%20-%20Me%20-%20Please.txt"
    I'm not sure what to call that process of converting the file name so I've been unable to google it up to find a fix or a way to change the behavior of the file manager.
    I've checked the settings in Nautilus and nothings there. Any clues? Thank you!
    Last edited by orv (2007-12-14 23:11:59)

    I tried removing everything in my home directory to erase all settings, still the same problem.
    I tried using a different file manager and still the same problem.
    Here's another example of my problem and its quirks:
    Lets say I have a file called:
    /home/orv/I am a Movie.avi
    In nautilus or thunar, double-clicking that file so I can play it with Mplayer will give an error:
    Failed to open file:///home/orv/I%20am%20a%20Movie.avi
    However, when I drag and drop using the file manager into Mplayer, it works.
    So my problem is this automatic conversion of whitespaces into the %20 which I don't know how to turn off.

  • I am using Firefox 3.6.13 and have installed Windows Media Player 1.0.0.8 for Firefox. However, if I attempt to open a file with a .wmv extension it appears to function properly, except, that I cannot "play" the file. What am I doing wrong?

    # Question
    I am using Firefox 3.6.13 and have installed Windows Media Player 1.0.0.8 for Firefox. However, if I attempt to open a file with a .wmv extension it appears to function properly, except, that I cannot "play" the file. What am I doing wrong?

    You probably have not seen anyone reporting the exact same problem as you. All three crash reports have the same crash signature and as currently ranked 67 it is not the commonest of reasons for a crash.
    I hope you enter your email contact information when reporting crashes. I note you see this crash when using videos, others may possibly see this crash in other circumstances.
    You have already tried the obvious, attempts at a fix so it is now down to wait and see, maybe developers working on the bug will report something or fix it.
    Did you try my suggestion of installing portable ESR ?
    For forum cross referencing purposes
    * Crash Reports for Crash IDs <br />bp-71697f5d-41d4-48ae-9db9-3e6302130607<br /> bp-6e1347bc-153f-433a-9c35-a5f022130607<br /> bp-92a533a2-9e09-4c1e-8df7-deb4c2130607
    *(all three) Crash Signature: EnumSoftwareMFTs(_GUID const&, unsigned int, __MIDL___MIDL_itf_mfobjects_0000_0006_0003 const*, __MIDL___MIDL_itf_mfobjects_0000_0006_0003 const*, IMFActivate***, unsigned int*)
    * Related bug 858667 NEW crash in mozilla::wmf::MFTEnumEx @ EnumSoftwareMFTs
    *I note this was first seen in Fx21 and is 100% Windows 7
    <br />

  • I am unable to open files on amything!!! a box pops up that asks me what do i want to open the file with..every time!! I want files to open when i click on them!! This happens with emails, websites, everything

    I try to open attachments in emails and they will not open! A box comes up asking 'what do I want to open the file with', and it wants me to select from a list of options like - Firefox, IE, Word, Yahoo Browser. When I make a selection (usually Firefox) a new tab opens with a blank page! This always happens on attachments, links, websites......everything!

    These files were lost two years ago.
    That's not consistent with what you wrote in your first message. I can't help you unless I know what's going on. Either you do, or do not, have backups of all the data you want to keep. If you do not, then the first thing you need to do is back up those files. It makes zero sense to do anything else. In order to back up, you'll need either of two things: another Mac, in working order, with a FireWire port and enough space on its internal drive to hold your files; or an external drive, also with enough space.
    On the other hand, if you do have backups, or if you simply don't care about any of the data, then the solution to your problem may be quite simple. All you have to do is boot from your installation disc (your profile says you're running Mac OS 10.5), erase your internal drive, reinstall the Mac OS, then restore your data from backup. You will need to be selective in restoring software, because incompatible software may be what caused the issue.
    But it's also possible that you have a hardware failure, in which case you can't get your computer working again until it's repaired.

  • Error in opening a file with name in chinese characters with Runtime.exec

    The issue at hand is when I try to open a file with file name containing chinese characters in a localized environment in Windows through the following java code:
    Runtime.exec("rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}");
    the following error is thrown by windows.
    Cannot open file "C:\??.txt".
    with the exception
    java.io.IOException: CreateProcess: [Ljava.lang.String;@f5da06 error=2
            at java.lang.Win32Process.create(Native Method)
            at java.lang.Win32Process.<init>(Win32Process.java:66)
            at java.lang.Runtime.execInternal(Native Method)
            at java.lang.Runtime.exec(Runtime.java:566)
            at java.lang.Runtime.exec(Runtime.java:428)
            at java.lang.Runtime.exec(Runtime.java:364)
            at java.lang.Runtime.exec(Runtime.java:326)
            at Launcher.main(Launcher.java:26)
    When I try to use the same command (shown below) from the Windows Run command, the file opens sucessfully
    rundll32 SHELL32.DLL,ShellExec_RunDLL {File_With_FileName_containing_Chinese_character}
    Please suggest.
    Thanks in advance

    This may be a file association problem.  To solve that:
    In Windows 7:
    1. Right-click the file,
    2. Select "Open With" 
    select [Your Program Here]
    3. Check always use this program. 
    In Windows XP:
    1. Locate the file as you have described above
    2. Right click the file
    3. Select Open with from the pop-up menu
    4. Click Choose default program…
    5. Select Excel in the Recommended Programs box
    6. Check Always use the selected program to open this kind of file
    7. Click on OK.
    1.  Make Excel not available from Office 2007 listed under Programs and Features in Control Panel.
    2. Take a registry backup using the steps given here
    3. In the registry editor window expand HKEY_CLASSES_ROOT and navigate to .xls right and delete it.
    4. Exit Registry Editor
    5. Undo Step 1 to make Excel available.
    6.  Restart the computer and verify it the issue is fixed.
    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire

  • How to open a file with a link ?

    I am using servlets to design an application.
    The application supports uploading and downloading of .DOC and .RTF files.
    My problem is that I am opening an uploaded file via a link.
    OPen File
    The above is also working fine and opens the file in the IE browser.
    But my problem is that I want to open the file with MS-Word...as is done on many resume-building websites.
    1) How am I supposed to do that ?
    2) Can I specify ContentType="application/msword" in a link ?
    Please Help !!

    I did the foll. w.r.t a docbase.
    A docbase stores documents and assigns an unique id to each one. The foll. is a code snippet that opens a document's contents in a browser.
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    Connection conn = null;
    Statement stm;
    ServletOutputStream sos = null;
    ResultSet res;
    // .... get id of document u want to open
    query = "select id from .. where object_name = ' xx' .."
    res= stm.executeQuery(query);
    Blob blob = res.getBlob("_content"); // this will get content of document identified by id
    int blobLen = (int)blob.length();
    //the foll. is the part u need..
    if (blobLen > 0) {
    InputStream contents = blob.getBinaryStream();
    response.setContentType("application/msword"); // MS Word
    byte[] buf = new byte[blobLen];
    int length = -1;
           while ((length = contents.read(buf)) != -1){
              sos = response.getOutputStream();
              sos.write(buf,0,blobLen);
    sos.flush();
    System.out.println("Doc Received");
    contents.close();
      res.close();
      conn.close();
    }

  • I can't open PDF files with adobe flash player

    I have installed it and whenever I try to open pdf files it says I need to agree with your liscens and you do that automatically when you download it. I have followed all your instructions on your website and uninstalled it and installed again, but I can't open pdf files with it. I don't know what the problem is exactly, but it's really frustrating..

    Flash Player CANNOT open PDFs because they AREN'T Flash Documents.
    Adobe Reader opens PDFs.
    To accept the license agreement (NOT the one you accepted to download or install - the one for USE)
    Windows:
    Go to: C/Program Files(x86)/Adobe/Reader 11.0/Reader and double click the eula.exe file. The license agreement will open for you to accept.
    Mac:
    Go to: Mac HD/Applications and double click the Reader app. The license agreement will open THE FIRST TIME you open it.

Maybe you are looking for