How can I create a shortcut to launch an external application?

Hello, I'm developing app in Swing where I want to create a shortcut for any external application, I'm able to get the .exe path, and an icon path (in .png format), is there a way to create a "shortcut" or button and assign the icon and the .exe path to run it? This is what I have to get the .exe path:
Process p = Runtime.getRuntime().exec("\"" + jTextField2.getText() + "\"");
Where jTextField takes the value from a JFileChooser value, doing the same for the icon, then I could do this for a button to assign the icon:
ImageIcon img1 = new ImageIcon("C:\\image.png");
jButton7.setSize(64, 64);
jButton7.setIcon(img1);
But I havent' found any way to make the button (or any kind of shortcut) to execute the program, I could go and create a method to do it on click or ActionPerformed, but the idea is to do all this when I finish the create the shortcut, I hope you can understand me, I'm kinda confused, so far, I can launch the app but I want to create a new button/shortcut everytime I need to add an external app, thanks in advanced!!!

user3538005 wrote:
Hello, I'm developing app in Swing where I want to create a shortcut for any external application,.. For what end purpose? If it is to show documents in the default consumer for that document type (e.g. a .doc might be MS Word), then look to the <tt>java.awt.Desktop</tt> class.
..I'm able to get the .exe path, and an icon path (in .png format), is there a way to create a "shortcut" or button and assign the icon and the .exe path to run it? This is what I have to get the .exe path:You do realize that is disgustingly Windows specific, right? What about users of Mac and *nix?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How can I create a new folder in an external disk that is connected via USB to my Mac?

    How can I create a new folder in an external disk that is connected via USB to my Mac?

    Just like you would create a new folder anywhere. Open the drive's icon from your desktop or the Finder, and click shift-command-N. (Or use the Finder menu if you prefer - File - New Folder).
    If you can't create a folder, your drive may be the wrong format (you can't write to a Windows/NTFS formatted drive, for example). You'll have to back up any files you have on there, and then use Disk Utility to reformat it to Mac Extended (if it will only be used on a Mac) or MS-DOS format (if you want to share it with a PC).
    Matt

  • How can I create a shortcut to a tools menu option?

    I use the clone stamp and the brush tool regularly. Each of these tools provides a Mode: dropdown list to select from in their menu bar.
    The drop down options I use most frequently are Lighten and Darken. I would like to create short cuts to Lighten and Darken, such as Ctrl+Shift+L (Lighten) and Ctrl+Shift+D (Darken).
    The tools panel menu bar does not appear to have a selection list in the Keyboard Shortcuts dialog box.
    How do I create these shortcuts.
    Thank you in advance,
    Jim

    They are already there.  The same shortcuts that affect layer blend modes when other tools are selected, do exactly the same thing when the Brush; Clone, Healing Brush, Blur, Sharpen and Smudge tools are selected.  (I forgot the gradient tool)
    So with the Move tool or a Marquee selected
    Shift Alt + scrolls down through the selected blend modes
    Shift Alt - scrolls up through the selected blend modes
    Your can go directly to specific Blend modes with first letters
    Shift Alt n = Normal
    Shift Alt m = Multiply
    Shift Alt s = Screen
    Now select the brush, or one of the tools that have blend modes, and the same keys will do the same job for that tool's blend mode.

  • How can i create datasource on apache server for ADF application?

    Hi All,
    i my use case i have created simple adf application using ADF BC and want to deploy on Apache server 6.x.
    So my question is that  how can i create Data Source i have goggling and find  two different way to do this.
    1. write following line of code on apache server conf/Context.xml file.
    <Resource name="jdbc/TestDB" auth="Container"
                  type="javax.sql.DataSource"
                   driverClassName="oracle.jdbc.OracleDriver"
                  url="jdbc:oracle:thin:@localhost:dst"
                  username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
                  maxWait="-1"/>
    but when i have used this way i got following exception.
    org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
    check link-
    https://forums.oracle.com/thread/2564233
    2. write following line of code apache conf/Server.xml file
    <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <Resource name="UserDatabase" auth="Container"
                  type="org.apache.catalina.UserDatabase"
                  description="User database that can be updated and saved"
                  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                  pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/TestDB" auth="Container"
                  type="oracle.jdbc.pool.OracleDataSource"
                  description="User database that can be updated and saved"
                  driverClassName="oracle.jdbc.driver.OracleDriver"
                  factory="oracle.jdbc.pool.OracleDataSourceFactory"
                  url="jdbc:oracle:thin:@//172.31.43.207:1521:dst"
                  username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
                  maxWait="-1"   />
      </GlobalNamingResources>
    and add this line in context.xml file inside <context> tag
    <ResourceLink global="jdbc/TestDB" name="jdbc/TestDB" type="oracle.jdbc.pool.OracleDataSource"/>
    but when i have run application i have got following error
    log-
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: invalid arguments in call"
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:298)
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:181)
      at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:110)
      at org.apache.jsp.test_jsp._jspService(test_jsp.java:63)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
      at java.lang.Thread.run(Thread.java:662)
    Aug 2, 2013 5:17:21 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: invalid arguments in call"
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:298)
      at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:181)
      at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(test_jsp.java:110)
      at org.apache.jsp.test_jsp._jspService(test_jsp.java:63)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
      at java.lang.Thread.run(Thread.java:662)
    so what is the solution how to create datasource on apche server which suitable for adf application?
    when i test data source using  following code used 1. way as i mentioned above  its running fine bt not for second.
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <sql:query var="rs" dataSource="jdbc/TestDB">
    select empname from pay_emphdr where empcd='JK1306'
    </sql:query>
    <html>
      <head>
        <title>DB Test</title>
      </head>
      <body>
      <h2>Results</h2>
    <c:forEach var="row" items="${rs.rows}">
        Foo ${row.empname}<br/>
    </c:forEach>
      </body>
    </html>
    please help me. it is very urgent.
    thanks in Advance
    Manish

    Hi Lindalnci
    i have already tried  this tutorial and in my post i have defined first way to do using this procedure.
    in that case i have got following exception as i have mentioned above
    org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection

  • How can I create a shortcut to my application?

    Hello
    I have just created my first application, and I would like to start it from a shortcut in my winXP desktop. But how can I since it is not an .exe file? I am using the NetBeans IDE 3.5.1 that comes with the java bundle, and I have tried unsuccsessfully to find some solution there. I have also scanned both of my Java books (for beginners...:) without luck. I appreciate any help you can provide.
    Jens

    hi,
    just download FreeJava or JCreator and save ur application as a project and then convert that project to an executable jar file. make a shortcut to this executable .jar file which will start ur project from the desktop.

  • How can I change the default program for the external applications editor?

    I have read the on line directions for this and it reads "select a file type in the left pane."   I do not see where this is in the left pane.  All I see in the left pane is "Browser start pages" and a "How do I " Pane.  Nothing with file types.

    Hello,
    Welcome to Adobe Forums.
    In order to change the default program for the external applications editor. Please follow the steps as mentioned below.
    Click on Edit menu then choose preferences.
    Once the preferences dialog box open.
    click on file editors.
    On the Left pane you will find all the file types which you want to edit .
    On the right hand side you will find the editors for that specific file type.
    If you want to add any other application you need to click on + symbol at the top of right pane.
    Select the path of that application which you want to apply.
    clcik on open.
    If you want to make it primay you can click make primary option available at the right hand top. For more detials please check the screenshot below.
    Regards,
    Rajeev

  • How can we Create a Media with all the OS,Applications and drivers with cutomize settings in MDT to automate the deployment

    Hi,
    I need to Create a media along with all the packages (OS,Drivers, Applications and customized settings) through MDT for the windows 8.1 deployment.
    Can someone guide me?
    Shailendra Dev

    Hi,
    Here are 3 great links to get you started:
    http://technet.microsoft.com/nl-nl/windows/dn481547
    http://c-nergy.be/blog/?p=3968
    http://windowsitpro.com/windows/create-windows-7-media-deployment
    This should provide you enough information to do what you want.
    If this post is helpful please click "Mark for answer", thanks! Kind regards

  • How can I create a new Music Library?

    Had to buy new laptop which of course has Vista. The old unit was acting up(I think Windows XP was corrupt), so I saved my Library Files but it looks like the old machine only saved portions not the whole Library. I had approx. 13,000 tunes (35GB) in the LIbrary and all that was saved seems to be 319 tunes. I have all the music on an external HD and only the Library was on the laptop. My question is, how can I create a new Library from the external HD music? Is there a way or am I SOL? Any suggestions and help would be greatly appreciated.

    You need the entire libary on the external, not just media.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605
    Once you get a complete iTunes folder on the external drive, start iTunes with the option/alt key held down and select the iTunes Library.itl file on the external drive.  You will also need to do this with your main computer or the libraries will become unsynchronized.
    Alternatively you can make a separate library using the same media on the second computer. Start as you have been doing, let iTunes create a new, blank library file which will be on hte internal drive, set the media folder location in preferences to be the one on the external drive, then add the files to the new iTunes library. Unless you are a super-organized individual, or you don't care if your libraries do not have the same content, you are better off using a single library file that is on the external, not setting up separate library files.

  • How can I create an iPhoto Library from photos on an external drive?

    Here's my issue:
    I have a MacBook Pro running OS X Mavericks, and I am just about out of hard drive space.
    I also have about 20 GB worth of photos on an external drive. The photos are not organized at all, just got dumped into a folder there during a hasty backup a couple years ago.
    I'd like to use iPhoto to get these photos organized, but don't have the space to import them into the library on my laptop.
    How can I create and manage an iPhoto library with these photos while keeping them on the external drive? They are on a terabyte drive, so I have a feeling I'd like to make that my main library moving forward.

    Check that the drive's formatted as Mac OS Extended, drag the iPhoto library to it, launch iPhoto with the Option key held down, and choose that library.
    (114618)

  • How can I create a slideshow that depicts only a version of a photo rather than the original? Since the original and new versions are saved together, the aperture slideshow often choices the original rather than the desired version to display/

    How can I create a slideshow that depicts only a version of a photo rather than the original?   Since the original and new versions are saved together, the aperture slideshow often choices the original rather than the desired version to display.

    There are two things we use the name "Slideshow" for in Aperture:  a Slideshow Album, used for making Slideshows, and the Slideshow that is made.  (Imho, it is a design mistake to not call the containers used to create Slideshows, Books, etc., "Albums".)
    The Slideshow will use the Album Pick from any Stack.  A good way to use Aperture is to promote the Image you want to regularly use (such as, for example, a Version with adjustments) to the top of the Stack.  This makes it the Stack Pick, and will be the default Album Pick.  If you haven't done that, you can still change the Album Pick for any Stack in a Slideshow Album.  Expand your Stack(s), select the Image in each Stack that you want to be the Album Pick (and thus shown in the Slideshow), and "Stacks➞Set Album Pick".  (Note the keyboard shortcut; there is also a Toolbar icon for this.)  The change is immediate.  The Slideshow will always show the Album Pick (or, if there is not one, the Stack Pick) for every Stack in your Slideshow Album.

  • How can i Create Domain in the Weblogic 7.0

    hi !..........
    how can i create Domain in weblogic server 7.0 plz send the replay ASAP..
    thanks in advance
    From
    Sree

    Go to the directory:
    %BEA_HOME%\weblogic700\common\bin
    Start the batch or shell named as dmwiz.cmd / dmwiz.sh
    This should be able to launch a wizard and take you through the process.
    Thanks and regards,
    Paz

  • I Have iPhoto on my macbook pro under a different account, how can I create/install my own iPhoto?

    I Have iPhoto on my macbook pro under a different account, how can I create/install my own iPhoto?

    The iPhoto application should be installed in the "Applications" folder and thus available for all users on your MacBook Pro.
    When you launch iPhoto from a different account hold down the ⌥-key, to be prompted where you want to create a new iPhoto library for that account. By default an iPhoto Library would be created in the "Pictures" folder of that user account.
    Regards
    Léonie

  • How can I create the recovery discs for my AIO computer? (For Windows 7 systems)

    Q.: How can I create the recovery discs for my MSI laptop/AIO computer? (For Windows 7 systems)
    A.:
    1. Locate the "MSI BurnRecovery" shortcut on your desktop or start menu. Run this program. (Note: If UAC is enabled, press "Yes" to allow the program to run.
    2. MSI BurnRecovery will prepare the files. This process may take a few minutes.
    3. Click on "Next" to continue.
    4. Click on "Advanced".
    5. Click on "Create an ISO file for the recovery disc".
    6. Select the destination where you want to create the ISO files. (Default is the D: drive)
    7. The program will now create the ISO files. This process may take up to 20 minutes.
    8. Click on "Finish". Make sure the box is unchecked.
    9. Browse to the location of the ISO files. Double-click the recovery_dvd file. (Note: Depending on your system, you will have 1-3 recovery_dvd files)
    10. Insert a blank DVD (If the AutoPlay window pops-up, close it). Click on "Burn". It is also recommended to check the box to verify disc after burning.
    11. After burn is complete, click on "Close".
    12. Double-click the recovery_dvd2 file.
    13. Insert a blank DVD (If the AutoPlay window pops-up, close it). Click on "Burn". It is also recommended to check the box to verify disc after burning.
    14. After burn is complete, click on "Close". Recovery disc creation is now complete. (You can also delete the ISO files, but it is recommended to keep them)

    Hi,
    You can order a replacement set of Recovery Discs using the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00810334&cc=us&lc=en&dlc=en
    If you have any problem with this link, order them directly from HP.
    If you live in the US, contact HP Here.
    If you are in another part of the world, start Here.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • How can I create a file brows menu and save option?

    How can I create a file brows menu, if I wont my user to choose a picture from his PC.
    And how can I save my user settings?(this is application going to be only on my users pc)

    You can launch a file selection dialog with FileReference. You can save settings using a SharedObject (like a cookie).
    http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_7 .html
    http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_3.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=lsos_5.html
    If this is a Flex app, you will only be able to select a file from the local machine and upload to server, you won't be able to open the file in the Flex app, due to security sandbox.
    If this is an AIR app you will not have this restriction.
    If this post answers your question or helps, please mark it as such.

  • I would like to know how do you create a shortcut for a webpage for your desktop?

    I would like to how if possible, how do you put a "shortcut" on your desktop when using Firefox?
    Thank you for your time.

    ''how do you create a shortcut for a webpage for your desktop?:''
    Drag the favicon at the left side of the location bar to the desktop
    Reference: (you can also do from bookmarks)
    * https://support.mozilla.com/kb/Creating+a+desktop+shortcut+to+a+web+page

Maybe you are looking for

  • Possible to do make Batch Sequence Searchable by date?

    I want to know if it is possible to edit/create new script to Edit Batch Sequence - Searchable, recognize text Using OCR, but to only do it for a date range? How would I go about doing this. Right now it takes multiple screens and clicks to make docu

  • Corruption in a log file

    Problem Description: alter database open ERROR at line 1: ORA-00368: checksum error in redo log block ORA-00353: log corruption near block 75 change 898387731 time 11/07/2009 17:15:29 ORA-00312: online log 2 thread 1: '/opt/oracle/archivelogs/online_

  • Make an hierarchical Tree in oracle Forms 6i

    Hi everybody, I want to make an hierarchical tree. I work in Forms 6i I create one non database block e.g. 'Bloc2' then add hierarchical control item in that. e.g 'Menu'. I create a record group named 'RG_DATA_TEST' Before I use a table in this recor

  • Invalid number error while using apex_item.text_from_lov_query

    When i try to create a simple apex_item.text_from_lov_query , i get following error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small Code is : SELECT apex_item.text_from_lov_query (prj_id, 'select prj_desc,prj_id from prj

  • Outlines around flash objects

    When I roll my mouse over the flash obejects on my page an outline of the object appears. When I click on the objects the outline goes away. Is there a simple way to get rid of these outlines that appear?