Results 1 to 4 of 4
  1. #1
    Chika is offline Member
    Join Date
    Sep 2010
    Posts
    7
    Rep Power
    0

    Default Open the file by mouse click

    chau! maybe my question will be very simple, but i can't find the answer - how can i open the file by the mouse click? i want to open pdf file in Adobe Acrobat or doc in MS Word.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default

    how can i open the file by the mouse click
    Where is the cursor when you do the mouse click?

    How is java programming involved in this problem?

    On some OSs the file will open when you click on it.

  3. #3
    Chika is offline Member
    Join Date
    Sep 2010
    Posts
    7
    Rep Power
    0

    Default

    i have an application written in java. i want just to open some file stored in d:// by clicking on the button. so, i have ActionListener and path to the file, but how could i open this file?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default

    The java program can't see the mouse click on OSs files.
    If you are talking about a mouseclick on a java component, then the java program can execute an OS program by using the Process and Runtime classes.
    Each OS has its own default program to use to "OPEN" a file.
    The Desktop class will do this.

Similar Threads

  1. change color on mouse click
    By hannerz06 in forum New To Java
    Replies: 3
    Last Post: 03-31-2010, 10:46 PM
  2. How we can open a file with a click in button
    By kostinio in forum AWT / Swing
    Replies: 2
    Last Post: 11-01-2009, 05:46 PM
  3. Using an EMG signal to create a mouse click
    By cmc419 in forum New To Java
    Replies: 1
    Last Post: 03-27-2009, 06:38 PM
  4. mouse click do not work after repaint
    By nobody in forum Java 2D
    Replies: 8
    Last Post: 12-07-2008, 05:43 PM
  5. mouse click alert
    By amir in forum AWT / Swing
    Replies: 1
    Last Post: 08-05-2008, 11:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •