DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: creating links

  1. #1
    Join Date
    Jul 2004
    Posts
    4

    creating links

    Hello every1.

    I'm having a tough time trying to make a button(when clicked) link or point to a partucular file(e.g setup file) and run that file within the same system.
    Please help!

    a little code will help.

    thanks in advance

  2. #2
    Join Date
    May 2004
    Posts
    219
    You want to run a windows executable?

    Code:
    JButton button = new JButton("Fraps!");
    
    button.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        try
        {
          Runtime rt = Runtime.getRuntime();
          rt.exec("C:\\Fraps\\fraps.exe");
        }
        catch (Exception ioe)
        {
          ioe.printStackTrace();
        }
      }
    });
    If you are dealing with websites, use BrowserLauncher.

  3. #3
    Join Date
    Jul 2004
    Posts
    4
    Yea! thanks Drain, I got that working alright.
    Thanks for the help

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links