+ Reply to Thread
Results 1 to 5 of 5

Thread: A piece of Interesting Code

  1. #1
    naives is offline Senior Member naives is on a distinguished road
    Join Date
    May 2007
    Location
    India
    Posts
    513

    Default A piece of Interesting Code

    I was trying to open a word file using Visual Basic and came across this code. I really don't had a idea that using Java I can do this. And was really excited about this. And thought this was worth sharing. So here is it

    Import java.io.*;

    public class Doc
    {
    public static void main(String[] str)throws IOException
    {
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.exe document.doc");
    }
    }



    Here
    Document is- filename
    Winword-path of executable with which u want to open the file.
    So using this code you can open a .doc file in Microsoft Word

  2. #2
    snoop1990 is offline Senior Member snoop1990 is on a distinguished road
    Join Date
    Dec 2007
    Location
    Germany (in a small town)
    Posts
    357

    Default

    Thank you for sharing code, but this is no javascript this is java. Java and Javascript have nothing to do with each other. Javascript is for web development and especially used for dynamic content on a web page, while java is an language that is used for graphical applets or stuff like what you suggest. But in general you do not use java for webdevelopment.

    Regrades Snoop1990

  3. #3
    joeally is offline Junior Member joeally is on a distinguished road
    Join Date
    May 2008
    Posts
    4

    Default

    Of course Java is used on the web snoop. Have you not heard of Java servlets or JSP, these some of the most popular server side technologies used( not that I use them I'm more into python).

    You are obviously not experienced in web development. But Java is not JavaScript so should not be posted here

  4. #4
    snoop1990 is offline Senior Member snoop1990 is on a distinguished road
    Join Date
    Dec 2007
    Location
    Germany (in a small town)
    Posts
    357

    Default

    Sure I know about java ! but keep in mind what web development is ;-). Java on the web is used like flash to design graphical interfaces (webpages). The important point is java is used to present information not to work with.

    For example you can have a php core and instead of creating static html as output you can show your information with java.

    You can also use java for core web development but I do not know any reason why I should use java instead of python, or php, ruby, perl ... There are different tastes after all, but in general you use java on the web just to present information. Like you also use javascript or flash to present information while the server handles your requests as python threats or so.

    And as I already mentioned this part of the forum is desired for java script not java !

  5. #5
    tronador is offline Member tronador is on a distinguished road
    Join Date
    Jun 2008
    Posts
    41

    Default

    You can use Java for web development but you server must support JSP (Java Server Pages), it is use frecuently in big companies and enterprise developments

+ Reply to Thread

Similar Threads

  1. I would like to ask for some interesting but affective advertisements?
    By Barbarossa in forum Business and Finance Forum
    Replies: 0
    Last Post: 01-28-2010, 10:45 PM
  2. How can I use greasemonkey to rewrite a piece of CSS?
    By Clever Nickname in forum HTML/CSS/DHTML
    Replies: 0
    Last Post: 01-17-2010, 02:42 PM
  3. Replies: 2
    Last Post: 01-02-2010, 07:54 PM
  4. Replies: 0
    Last Post: 12-28-2009, 02:22 PM
  5. What would make an interesting movie
    By Jadscape in forum General Discussions
    Replies: 3
    Last Post: 12-30-2008, 08:56 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