creating links


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center