11 Replies - 2894 Views - Last Post: 19 February 2008 - 12:52 AM Rate Topic: -----

#1 fsloke  Icon User is offline

  • D.I.C Regular

Reputation: 25
  • View blog
  • Posts: 412
  • Joined: 19-December 07

Have Any Java API can open file directly using code?

Posted 29 January 2008 - 12:46 AM

Is there have any simple coding , that can open the File (doc,txt) using it own application such as Ms Word...


-thank...
Is This A Good Question/Topic? 0
  • +

Replies To: Have Any Java API can open file directly using code?

#2 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Re: Have Any Java API can open file directly using code?

Posted 29 January 2008 - 01:11 AM

The BufferedStream class is a good way to read raw text files, however you will find Microsoft Word documents are much different when it comes to I/O (Input/Output).

You can learn about it here. :)
Was This Post Helpful? 0
  • +
  • -

#3 GWatt  Icon User is offline

  • member icon

Reputation: 278
  • View blog
  • Posts: 3,078
  • Joined: 01-December 05

Re: Have Any Java API can open file directly using code?

Posted 29 January 2008 - 07:39 AM

Opening any document with formatting is more difficult. If you open a .doc file with notepad you will see a whole bunch of formatting instructions, and the actual text of your document will virtually unreadable.
Was This Post Helpful? 0
  • +
  • -

#4 fsloke  Icon User is offline

  • D.I.C Regular

Reputation: 25
  • View blog
  • Posts: 412
  • Joined: 19-December 07

Re: Have Any Java API can open file directly using code?

Posted 30 January 2008 - 04:31 AM

I think you all misunderstood my Question.

When the user click on the File example file.doc.

The File.doc will open using Ms Word application...

Then the file is in the Ms Word application...

Is there have such coding?

-fsloke
Was This Post Helpful? 0
  • +
  • -

#5 Nayana  Icon User is offline

  • DIC Hawk - 나야나 नयन:
  • member icon

Reputation: 31
  • View blog
  • Posts: 824
  • Joined: 14-November 07

Re: Have Any Java API can open file directly using code?

Posted 30 January 2008 - 07:16 AM

Try looking at the Runtime.exec() command.
Was This Post Helpful? 0
  • +
  • -

#6 fsloke  Icon User is offline

  • D.I.C Regular

Reputation: 25
  • View blog
  • Posts: 412
  • Joined: 19-December 07

Re: Have Any Java API can open file directly using code?

Posted 04 February 2008 - 09:56 PM

This command is run in terminal....

This sure can be done if we run it in terminal

But have any alternative?

Thank
Was This Post Helpful? 0
  • +
  • -

#7 Nayana  Icon User is offline

  • DIC Hawk - 나야나 नयन:
  • member icon

Reputation: 31
  • View blog
  • Posts: 824
  • Joined: 14-November 07

Re: Have Any Java API can open file directly using code?

Posted 04 February 2008 - 10:53 PM

what?
Was This Post Helpful? 0
  • +
  • -

#8 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: Have Any Java API can open file directly using code?

Posted 04 February 2008 - 10:57 PM

fsloke, take your time and try to explain the question a little better.
Was This Post Helpful? 0
  • +
  • -

#9 Cyborg Ninja  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 29-January 08

Re: Have Any Java API can open file directly using code?

Posted 05 February 2008 - 12:47 PM

I think Post #4 sounds like file associations.
Was This Post Helpful? 0
  • +
  • -

#10 fsloke  Icon User is offline

  • D.I.C Regular

Reputation: 25
  • View blog
  • Posts: 412
  • Joined: 19-December 07

Re: Have Any Java API can open file directly using code?

Posted 17 February 2008 - 12:17 AM

You can open txt file and do read and write on a txt file.

We can output to JTextArea byte by byte using input output file.

My Question is How to do output and input file on a complex application such Ms Word, and PDF file?

My concern is open for view only....
Was This Post Helpful? 0
  • +
  • -

#11 GWatt  Icon User is offline

  • member icon

Reputation: 278
  • View blog
  • Posts: 3,078
  • Joined: 01-December 05

Re: Have Any Java API can open file directly using code?

Posted 17 February 2008 - 07:45 AM

You have to have some way of interpreting the data. .doc, .pdf, and the like are pretty much all text files, but they contain special formatting instructions. You can open them with notepad if you want to see what they look like raw, but I don't know any more than that.
Was This Post Helpful? 0
  • +
  • -

#12 bhandari  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 9
  • View blog
  • Posts: 754
  • Joined: 31-January 08

Re: Have Any Java API can open file directly using code?

Posted 19 February 2008 - 12:52 AM

I have done some work for you. Google was my starting point.

various pdf libraries
IText pdf library example

Use the above links and explore the internet for MS Word format.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1