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.
Printable View
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.
Where is the cursor when you do the mouse click?Quote:
how can i open the file by the mouse click
How is java programming involved in this problem?
On some OSs the file will open when you click on it.
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?
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.