Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2008, 02:23 PM
jazz2k8's Avatar
Member
 
Join Date: Apr 2008
Posts: 77
jazz2k8 is on a distinguished road
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
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-06-2008, 02:27 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road
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,संजीव
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-06-2008, 02:34 PM
jazz2k8's Avatar
Member
 
Join Date: Apr 2008
Posts: 77
jazz2k8 is on a distinguished road
my abc.doc is on my desktop i wants to open it..or rename it...(The Right Click Functionality)using java...
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-06-2008, 02:40 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road
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......
__________________
sanjeev,संजीव
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-06-2008, 02:57 PM
jazz2k8's Avatar
Member
 
Join Date: Apr 2008
Posts: 77
jazz2k8 is on a distinguished road
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...
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-06-2008, 03:10 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road
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,संजीव
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-06-2008, 03:14 PM
jazz2k8's Avatar
Member
 
Join Date: Apr 2008
Posts: 77
jazz2k8 is on a distinguished road
correct...
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-06-2008, 03:16 PM
sanjeevtarar's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Delhi(India)
Posts: 249
sanjeevtarar is on a distinguished road

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

Try this.

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,संजीव
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 05-06-2008, 04:00 PM
rjuyal's Avatar
Senior Member
 
Join Date: Mar 2008
Location: Delhi, India
Posts: 160
rjuyal is on a distinguished road
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
__________________
Newton said Gravitaion, Rakesh says Earth Sucks
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 05-06-2008, 04:00 PM
jazz2k8's Avatar
Member
 
Join Date: Apr 2008
Posts: 77
jazz2k8 is on a distinguished road
thanks i will try this
__________________
visit :
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AWT - catching click button event Java Tip Java Tips 0 03-12-2008 12:02 AM
How to perform some event to button click eva AWT / Swing 2 01-16-2008 01:27 AM
Middle Click Closes Tab Eclipse Plugin 1.0.0 JavaBean Java Announcements 0 10-20-2007 06:59 PM
how to click a jbutton and open an url katie AWT / Swing 1 08-06-2007 11:44 PM
Click Framework 1.3 levent Java Announcements 0 06-09-2007 09:27 AM


All times are GMT +3. The time now is 11:31 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org