When user double-clicks on a file, then I want my program to open it...

Ok, so I have been having a lot of trouble finding the answer to what I at first thought was a simple question.
I do not know, at all, how to make my program able to open files in the normal sense. Normal sense meaning user double-clicks my_file.xxx, or for that matter right-clicks my_file.xxx and selects open with, and then my_app.jar starts up and opens the file.
I have already created the app, and it runs nicely. This app has a menu bar with the usual File >> Open which works just fine reading my_file.xxx. My_app.jar can also saves my_file.xxx. So I am not having trouble with I/O.
So if someone can give me even the slightest hint in the right direction I'd be very thankful.
p.s. I am working on a mac but my_app.jar will be running mostly on windows so cross-platform is very important.

Actually, I was more wondering what kind of code I
need to add to my program to make it possible at all.
My file input and output is all done from a Utilites
class which I made but quite obviously any OS will
not know to call Utiities.load(...arguments...).
But, my goal is to have my program work as seamlessly
as possible with a normal person's desktop.I'm sorry, you're right, I completely misread your post. I would definitely take the tactic of writing a .reg file and executing it. That seems to be the accepted way of creating registry entries on Java if you have to do such a thing.
Here is a link to the type of .reg file you're going to need to associate a file with a certain program, and you'll need to modify it slightly to do a 'java -jar myJar' type of thing. Then, just point Runtime.getRuntime().exec() at it, and you should be good to go.
The only thing I'd be worried about is how to find the JAVA_HOME. If you launched your installer via WebStart (or had the user double-click the jar for the first time), though, you could just use
System.getProperty("java.home");

Similar Messages

  • Basic List:- Need to get data when user double click on report output

    Hi,
    My requirement is to display asset details as a report and when user double clicks on the asset details, transaction AS03 need to be opened.
    The output layout is as follows:
    Company code    800                             Asset class 111
    Asset 1 ................
    Asset 2.................
    Asset 3.................
    Company code    900                             Asset class 111
    Asset 1 ................
    Asset 2.................
    Asset 3.................
    when user double click on Asset 1 of Company code 800, then transaction AS03 need to be triggerd. But when I use ATLine selection. I only get the Asset1....details in the sy-lisel. But I need Company code for triggering the AS03 transaction.
    Please let me know any way of getting company code along with the Asset 1 ......
    Regards
    Suresh Kumar

    Hi,
    Herewith i am sending the sample coding for the report.
    REPORT YMS_INTERTESTALV .
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab1 OCCURS 0,
    vbeln TYPE vbeln,
    bstnk TYPE vbak-bstnk,
    erdat TYPE vbak-erdat,
    kunnr TYPE vbak-kunnr,
    END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0,
    vbeln TYPE vbeln,
    matnr TYPE vbap-matnr,
    netpr TYPE vbap-netpr,
    kwmeng TYPE vbap-kwmeng,
    END OF itab2.
    DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
    DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    Get the fieldcatalog1
    PERFORM get_fieldcat1.
    Get the fieldcatalog2
    PERFORM get_fieldcat2.
    SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
    INTO TABLE itab1
    FROM vbak.
    IF NOT itab1[] IS INITIAL.
      SELECT vbeln matnr netpr kwmeng
      INTO TABLE itab2
      FROM vbap
      FOR ALL ENTRIES IN itab1
      WHERE vbeln = itab1-vbeln.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
              i_callback_program      = v_repid
              i_callback_user_command = 'DISPLAY_DETAIL'
              it_fieldcat             = t_fieldcatalog1
         TABLES
              t_outtab                = itab1.
    FORM display_detail *
    --> UCOMM *
    --> SELFIELD *
    FORM display_detail USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      DATA: itab2_temp LIKE itab2 OCCURS 0 WITH HEADER LINE.
      IF ucomm = '&IC1'.
        READ TABLE itab1 INDEX selfield-tabindex.
        IF sy-subrc = 0.
          LOOP AT itab2 WHERE vbeln = itab1-vbeln.
            MOVE itab2 TO itab2_temp.
            APPEND itab2_temp.
          ENDLOOP.
          CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
               EXPORTING
                    i_callback_program = v_repid
                    it_fieldcat        = t_fieldcatalog2
               TABLES
                    t_outtab           = itab2_temp.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM GET_FIELDCAT1 *
    FORM get_fieldcat1.
      DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
      s_fieldcatalog-col_pos = '1'.
      s_fieldcatalog-fieldname = 'VBELN'.
      s_fieldcatalog-tabname = 'ITAB1'.
      s_fieldcatalog-rollname = 'VBELN'.
      s_fieldcatalog-hotspot = 'X'.
      APPEND s_fieldcatalog TO t_fieldcatalog1.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '2'.
      s_fieldcatalog-fieldname = 'BSTNK'.
      s_fieldcatalog-tabname = 'ITAB1'.
      s_fieldcatalog-rollname = 'BSTNK'.
      APPEND s_fieldcatalog TO t_fieldcatalog1.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '3'.
      s_fieldcatalog-fieldname = 'ERDAT'.
      s_fieldcatalog-tabname = 'ITAB1'.
      s_fieldcatalog-rollname = 'ERDAT'.
      APPEND s_fieldcatalog TO t_fieldcatalog1.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '4'.
      s_fieldcatalog-fieldname = 'KUNNR'.
      s_fieldcatalog-tabname = 'ITAB1'.
      s_fieldcatalog-rollname = 'KUNNR'.
      APPEND s_fieldcatalog TO t_fieldcatalog1.
      CLEAR s_fieldcatalog.
    ENDFORM.
    FORM GET_FIELDCAT2 *
    FORM get_fieldcat2.
      DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
      s_fieldcatalog-col_pos = '1'.
      s_fieldcatalog-fieldname = 'VBELN'.
      s_fieldcatalog-tabname = 'ITAB2'.
      s_fieldcatalog-rollname = 'VBELN'.
      APPEND s_fieldcatalog TO t_fieldcatalog2.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '2'.
      s_fieldcatalog-fieldname = 'MATNR'.
      s_fieldcatalog-tabname = 'ITAB2'.
      s_fieldcatalog-rollname = 'MATNR'.
      APPEND s_fieldcatalog TO t_fieldcatalog2.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '3'.
      s_fieldcatalog-fieldname = 'NETPR'.
      s_fieldcatalog-tabname = 'ITAB2'.
      s_fieldcatalog-rollname = 'NETPR'.
      APPEND s_fieldcatalog TO t_fieldcatalog2.
      CLEAR s_fieldcatalog.
      s_fieldcatalog-col_pos = '4'.
      s_fieldcatalog-fieldname = 'KWMENG'.
      s_fieldcatalog-tabname = 'ITAB2'.
      s_fieldcatalog-rollname = 'KWMENG'.
      APPEND s_fieldcatalog TO t_fieldcatalog2.
      CLEAR s_fieldcatalog.
    ENDFORM.
    Thanks,
    Shankar

  • Hello.  I am running Photoshop CC 2014 on a MAC with OSX LION.  I also have Photoshop CS6 installed.  When I double-click on a file in Bridge CC, it always opens in CS6.  If I say "OPEN WITH Photoshop CC 2014", or if I drag the file directly to CC 2014 in

    Hello.  I am running Photoshop CC 2014 on a MAC with OSX LION.  I also have Photoshop CS6 installed.  When I double-click on a file in Bridge CC, it always opens in CS6.  If I say "OPEN WITH Photoshop CC 2014", or if I drag the file directly to CC 2014 in the Dock it will open in CC.  Since I like to double-click or hit return in the bridge, I am constantly having to wait until the file opens in CS6, quit CS6 an then open it another way to get it into Photoshop CC 2014.  I tried to disable CS6 by hiding it, but then double-clicking Bridge did nothing.  Any ideas why this is happening?

    Check and adjust the File Type Associations in the bridge cc preferences.

  • My computer had to be shut down this morning when I could move my mouse around but it would not respond when I double clicked on an item to select.  Now I cannot open a file in my finder window by double clicking on it.  Any suggestions?

    My computer had to be shut down this morning when I could move my mouse around but it would not respond when I double clicked on an item to select.  Now I cannot open a file in my finder window by double clicking on it.  Any suggestions?

    Did you reinstall CS3 after CC?
    For that matter, doing an in-place upgrade on the OS is always a gamble with Adobe programs. Reinstalling all the versions you need, in order, would probably solve your problem.
    And you shouldn't need to save as IDML after opening the .inx in CC.

  • Double clicking on a file launches the app but doesn't open the file anymore. Why?

    Double clicking on a file launches the app but doesn't open the file anymore. Why?

    I would post in the Illustrator forum here http://forums.adobe.com/community/illustrator or the Dreamweaver forum here http://forums.adobe.com/community/dreamweaver. One of these product forums will be able to help.

  • Project locks up when user double clicks click box

    I have a series of practice questions in my Captivate 5 projects that use click boxes to select the question's answers.  The project pauses at the click boxes (which all appear at the same time), and a feedback caption appears.  A second later, a continue button appears.  The project again pauses until the user clicks the continue button.  Then the project goes to the next slide.  My problem is that when the user double clicks a click box,  or clicks it right when it appears (the cursor changes from arrow to a hand), the continue button does not appear.
    I am just considering deleting the continue button but my intent there was to allow as much time as the user needed to read the feedback captions after clicking the click box.  Any help on this is appreciated.
    Options selected on click box: hand cursor, and pause project until user clicks.
    Thanks.

    Actually, I was more wondering what kind of code I
    need to add to my program to make it possible at all.
    My file input and output is all done from a Utilites
    class which I made but quite obviously any OS will
    not know to call Utiities.load(...arguments...).
    But, my goal is to have my program work as seamlessly
    as possible with a normal person's desktop.I'm sorry, you're right, I completely misread your post. I would definitely take the tactic of writing a .reg file and executing it. That seems to be the accepted way of creating registry entries on Java if you have to do such a thing.
    Here is a link to the type of .reg file you're going to need to associate a file with a certain program, and you'll need to modify it slightly to do a 'java -jar myJar' type of thing. Then, just point Runtime.getRuntime().exec() at it, and you should be good to go.
    The only thing I'd be worried about is how to find the JAVA_HOME. If you launched your installer via WebStart (or had the user double-click the jar for the first time), though, you could just use
    System.getProperty("java.home");

  • Why the Finder doesn't make diefference between CS3 illustrator .eps and CS3 Photoshop .eps when I double click on a file?

    The finder used to make difference between Illustrator ans Photoshop .eps files except sometomes when these files came from a Windows PC, but now it doesn't work anymore and all .eps files are considereds as Photoshop .eps files.
    How can I revert to original default settings?
    Thanks. :-)

    Prior to Snow Leopard, Mac OS actually remembered what app created a file, and used that app when you double-clicked a file.  Now, Snow Leopard goes entirely by the suffix, modified by any particular settings you have made for that file in Get Info.
    If you want to recreate the old behavior, there is a third-party package called LaunchCodes that claims to do this.
    More information about the removal of the creator code here:
    http://www.cultofmac.com/how-snow-leopard-ditched-creator-codes-and-why-it-matte rs/15928

  • How do I embed a pdf document into an existing pdf so that the user double clicks on the pdf object within the pdf and it opens? i've looked everywhere on various forums and tried attachments - but still not working. Thanks

    I've tried various methods but to no avail. I have a pdf document and within the pdf I'd like to embed a couple pdf documents so that all the user has to do is double click on the pdf object inside the pdf and it opens in a new window. I've tried using attachments to do it and linking it...but to no avail. Anyone know how to do? I'm using Acrobat Pro Version 11. Thanks

    The "embed" feature common to MS Office applications is not applicable to PDF (for the why and wherefore of PDF get comfortable and read the ISO Standard for PDF - ISO 32000-1:2008).
    You can insert other PDF files' pages into any given PDF.
    You can attach files of supported formats to a PDF (of course a PDF is supported).
    You cannot "embed". So, nothing is broken.
    Be well...

  • When I double click a PS file, it opens PS but not the file. Why?

    Since I purchased CS5, I've found that double clicking, or dragging to the Ps (or Ai) icon in the dock will only open the program, but not the file. I then have to go back and double click the file again to bring it up. I've looked in preferences but cannot find a way to resolve this. A friend who also has CS5 does not have this problem.
    Thanks, Neil.

    Have you updated your OS lately?
    Are you on a Mac or a PC?
    That behavior usually is sign of a file vital for Photoshop (and some other Adpobe apps too) missing.
    I've published an old Adobe technote about that here http://www.ninisworld.com/thecorner/tutorials/photoshopopen.html including also the file needed on a Mac.
    If you are on a PC I have no solution to suggest.

  • How to get index of the item from table when user double click on an item

    Can anyone tell me how to get the corresponding index of a table in which
    elements are listed as array of strings? I am looking for the index of the
    item being double-clicked on?
    Thank you in advance
    Cheers,
    NQ.

    Hi NQ,
    Although the question is not thouroughly clear, I can give a few suggestions. You can use the property node for table to refer to any particular row or column of the table. The correpsonding elements in the property node will be "SelStart", "SelSize" etc. Just as a side thought, the index of a table starts with (0,0).
    I am attaching a test file. Please see if it helps you in figuring out what exactly you want. This example VI is just to help you try different options under property node (if you havent already tried)to get what you want.
    Regards,
    Sastry Vadlamani
    Applications Engineer
    National Instruments
    Attachments:
    test.vi ‏27 KB

  • HT2506 Why does Preview also open previously viewed files when I double click on a file to view it?

    Trying to figure out how to stop it from doing this - finding it irritating - or is it a 'feature'?
    Already checked the preferences menu, but no luck

    Ha! Just figured it out, thanks to checking the discussions - in the System Prefs, under 'General', unchecked 'restore windows when quitting & re-opening apps' & that seems to have done the trick

  • When i double click a photoshop file it does not open photoshop

    it used to open photoshop but now nothing happens, i have to go to photoshop and navigate for the file to open up. any ideas what do do to fix this?
    thanks

    http://forums.macosxhints.com/showthread.php?t=24619
    hope this helps - it worked for me

  • HT2548 how do i copy the domain file from OS 10.4 to a lion OS computer?  I made a copy of the domain file and copied it to my new computer, but it doesn't open in iweb when I double-click on it.

    How do I import an iweb domain file from an ibook (OS 10.4) to an imac (OS 10.73)?
    I copied the domain file from my ibook to my imac, but when I double-click on the file, it doesn't open in iweb. 

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.  Then place the domain file in your Users/Home/Library/Application Support/iWeb folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • Double click AI CS2 file, "Could not complete operation"

    Hi All,
    I do have an AI CS2 issue: When I double click and AI file to open, when AI is not running, I get the "could not complete operation" message. If I open AI first, then open the file all is well. I used to be able to open AI by doulble clicking the AI file.
    Any idea why that is?
    Thanks!

    rr,
    >I used to be able to open AI by doulble clicking the AI file.
    Please elaborate (before AICS2, before the full moon, before a change within Windows, or).
    Hi Steve.

  • Double click on .doc file opens Apple Works not Word 98

    I'm using Tiger on a 14" iBook. I have Office 98 installed which works OK running under the classic environment.
    Only thing is, I can't get it to start when I double click on a .doc file.
    I've been thru all the recommended stuff, select the file, "get info", change the application etc... Whatever I try, it just reverts to Apple Works. When I double click the .doc file, I get Apple Works instead of MS Word.
    Has any one got any ideas? Is this because Word 98 runs under Classic?
    Also, I can open a word (.doc) document by dragging it onto the dock icon for MS Word 98. But if I try the same with an Excel spreadsheet,(dragging it onto the excel icon) it doesn't work. Tiger doesn't seem to like the .xls extension. Was this extension used for something else?

    This document talks about applications which may use XLS:
    http://filext.com/detaillist.php?extdetail=XLS
    If it was used as a Microsoft Works document, you may need to convert it to Excel first.
    Not sure if Excel handles Works documents, but Appleworks does to a limited extent, and Maclinkplus by http://www.dataviz.com/ will better allow you to be able to handle files of unknown type that are spreadsheets.
    To change the application a document opens under control-mouse click a document with that extension and select Open With. Select the Other... and find the application in the dialog to open with, and check "Always Open With" if you want to open all documents with that extension with a specific application.
    Message was edited by: a brody with added info on Microsoft Works

Maybe you are looking for

  • Error in Sync Bo Creation

    Hi I am on WAS 6.40. And have defined my two own RFC's to be used for GetDetail and GetList. When I am generating the SyncBo. It gives the following error <b>'Function modules from the function pool Z_MEREP_GEN_T01_ZMIDELV contain syntax errors'</b>

  • Safari 4.0.3 ate half my bookmarks

    Once I downloaded Safari 4.0.3 my subfolders within my bookmarks vanished completely. When I go to "Show my bookmarks" I can only see the "loose" links I previously created ("loose" meaning those that were never placed within the subfolders). Hundred

  • Excel 2011 for Mac isn't displaying my graph properly.

    I have an excel spreadsheet that I use to track all my territory sales. There is a graph on the spreadsheet that reflects the numbers of the specific territory when I filter to that specific territory. Though it works on excel for windows it is not w

  • Error when addin an AR Reserve Invoice

    Hi all A client was adding an AR Reserve Invoice and got the following error: {SQL Native Client}{[SQL Server}Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <=, >, >= or when the subquery is used as an

  • FF 12 does not open attachments for yahoo email

    FF recently updated and since then I have not been able to open attachments in yahoo email. I know it's FF because it does not happen in IE or chrome. I have used FF for years and it is my browser of choice. However if I can not address this issue I