Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2009, 03:38 PM
Member
 
Join Date: Apr 2009
Posts: 17
Rep Power: 0
jasmu is on a distinguished road
Default Opening the Application
Hai,

How to open application(For eg. any file) using java code?

Thanks in advance....
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-17-2009, 03:39 PM
Senior Member
 
Join Date: Jun 2008
Posts: 1,397
Rep Power: 3
masijade is on a distinguished road
Default
I can only assume you want the DeskTop class. Check out the API docs for that class.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-17-2009, 04:06 PM
Member
 
Join Date: Apr 2009
Posts: 17
Rep Power: 0
jasmu is on a distinguished road
Default
Hi,

Thanks for ur reply.

Actually my requirement to open a pdf file using java program. I installed netbeans in my Mac Machine.

Without using this type of batch file ,can i open that file in any other way?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-17-2009, 04:14 PM
Senior Member
 
Join Date: Jun 2008
Posts: 1,397
Rep Power: 3
masijade is on a distinguished road
Default
What "type of batch file"? What are you talking about?

If you want to display a files contents solely using Java, and no other applications (which runs counter to what you asked in the first post), then you need to program your app in such a way that it recognises the file type and then uses the proper libraries to display it. And, no, there is "super function" that does all this for you.

For PDF Google for the iText library.

If you want to be able to have Java use some other application to display whatever file it wishes to display, then, as I have already said, see the API docs for the DeskTop class.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-17-2009, 04:53 PM
Member
 
Join Date: Apr 2009
Posts: 17
Rep Power: 0
jasmu is on a distinguished road
Default
Thanks for your reply,

For example,
in java program, i giving the path and file name to open the file.

i need a help,

Code:
File file1 = new File ("\\\\172.16.3.203\\transfer\\Mubeena\\DocStation.pdf");
        if (file1.exists ())
        {
//            file1.canExecute();
             // here i want to write the code, to open that file.
         }
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-17-2009, 07:42 PM
Senior Member
 
Join Date: Jun 2008
Posts: 1,397
Rep Power: 3
masijade is on a distinguished road
Default
Like I said, Google for iText if you want to display it yourself, and see the API docs for DeskTop if you want to use an external tool to display it.

At least try it.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 04-22-2009, 07:21 AM
Member
 
Join Date: Apr 2009
Posts: 17
Rep Power: 0
jasmu is on a distinguished road
Default
Thanks for your reply,

Code:
Desktop desktop = Desktop.getDesktop();
I Made the job done, using the above code
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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
opening ports prashant Networking 2 03-22-2009 09:23 PM
Opening in Java and .Net techinvo Jobs Offered 0 03-22-2009 08:24 AM
opening of an exe in JFrame smartsubroto New To Java 3 07-16-2008 06:01 AM
Opening a workspace twice javaplus Eclipse 0 01-08-2008 10:56 AM
Opening URLConnection Java Tip Java Tips 0 11-24-2007 08:37 PM


All times are GMT +2. The time now is 04:37 PM.



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