Results 1 to 10 of 10
  1. #1
    jazz2k8's Avatar
    jazz2k8 is offline Senior Member
    Join Date
    Apr 2008
    Posts
    150
    Rep Power
    7

    Default Funtioanlity of right click

    i would like to know the functionality of right click..meamning,.,,

    if i select one icon and right clicked then i wants to open that ...


    I want to perform this using java..if i run that program the output should be..the open file.

    thanks

  2. #2
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by jazz2k8 View Post
    i would like to know the functionality of right click..meamning,.,,

    if i select one icon and right clicked then i wants to open that ...


    I want to perform this using java..if i run that program the output should be..the open file.

    thanks

    Hello Dear,

    what exactly you want, where do you want to right click and what do you want to open ..??..which icon...??..on desktop..??
    What is open file ......??

    explain some more .....
    sanjeev,संजीव

  3. #3
    jazz2k8's Avatar
    jazz2k8 is offline Senior Member
    Join Date
    Apr 2008
    Posts
    150
    Rep Power
    7

    Default

    my abc.doc is on my desktop i wants to open it..or rename it...(The Right Click Functionality)using java...

  4. #4
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by jazz2k8 View Post
    my abc.doc is on my desktop i wants to open it..or rename it...(The Right Click Functionality)using java...
    On windows....??

    You mean that on windows desktop you will click on any doc or whatever file and then want to open....Open Option is already there.....

    Where you will use java....on desktop right click only......:confused::confused:
    sanjeev,संजीव

  5. #5
    jazz2k8's Avatar
    jazz2k8 is offline Senior Member
    Join Date
    Apr 2008
    Posts
    150
    Rep Power
    7

    Default

    Ahhh...so confusing....

    on my windows desktop i am having a file called abc.doc.In general i wants to open it through double click or right click open...if the same functionality i want it through my java code..got it..that means if i run my java program the abe.doc should open...

  6. #6
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by jazz2k8 View Post
    Ahhh...so confusing....

    on my windows desktop i am having a file called abc.doc.In general i wants to open it through double click or right click open...if the same functionality i want it through my java code..got it..that means if i run my java program the abe.doc should open...
    OK....

    means using java program you want to open word file.....correct.
    sanjeev,संजीव

  7. #7
    jazz2k8's Avatar
    jazz2k8 is offline Senior Member
    Join Date
    Apr 2008
    Posts
    150
    Rep Power
    7

    Default

    correct...

  8. #8
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default


    What i understand you want to open a word file using java code..If i am wrong then correct me.

    Try this.

    Java Code:
    import java.io.*;
    
    public class OpenWord 
    {
        public static void main(String[] args){
    	try{
    	
                String fileName = "C:\\New.doc";
    	    Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \""+fileName+"\"");
                // OR YOU CAN USE
    	    Runtime.getRuntime().exec("cmd /c \""+fileName+"\"");
    	    }catch(IOException err){  // or use catch(Throwable err)
    		   System.out.println("ERROR...."+err);
    	    }
    }
    }
    sanjeev,संजीव

  9. #9
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    For adding an option when you right click on .DOC file, you will have to edit registry. there you will have to add a new key and the path to your program. Now on right click you will see the option to open the .DOC file in your code.

    also, See above to implement the Opening of DOC file in JAVA
    i am the future

  10. #10
    jazz2k8's Avatar
    jazz2k8 is offline Senior Member
    Join Date
    Apr 2008
    Posts
    150
    Rep Power
    7

Similar Threads

  1. AWT - catching click button event
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-11-2008, 11:02 PM
  2. How to perform some event to button click
    By eva in forum AWT / Swing
    Replies: 2
    Last Post: 01-16-2008, 12:27 AM
  3. Middle Click Closes Tab Eclipse Plugin 1.0.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-20-2007, 05:59 PM
  4. how to click a jbutton and open an url
    By katie in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 10:44 PM
  5. Click Framework 1.3
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-09-2007, 08:27 AM

Posting Permissions

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