Java Help

Get help on programming - C++, Java, Delphi, etc.
Post Reply
Tiza
Registered User
Posts: 1486
Joined: 01 Dec 2004, 02:00
Location: At your window
Contact:

Java Help

Post by Tiza »

Yo guys

I am currently using Eclipse and busy on a school project. I have made a company called delivery Express and with teh Help of GUI you can access the database and I use SQL and all the rest.

I am done with all the coding just need to add some extra things. The one guy has a web browzer in his java application which is pretty cool.

I would like to add an email function, when the user clicks on a button I want the email application like Outlook or whatever to open with the name "L-Dog@delivery.co.za to appear in teh adress bar. Do you guys have any sweet code or suggestions for me ???

The code i currently have works at home but not at the school, it requires some libraries or something that the school does not have...


java.awt.Desktop.getDesktop().mail(new java.net.URI("mailto:L-Dog@DE.com"));


I was also jus looking for code that opens a word document, thanks :)
Image
I am a guy so please people stop sending me these shady pm's and start playing computer games or bodybuilding. Forums aren't a good place to get chicks the gym is...
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Java Help

Post by rustypup »

as for the web-browser, you have 2 approaches you could take... the one is to use a JEditorPane, and the other is to embed a browser like mozilla's gecko using freely available extensions... the former is actually quite fun as you'll learn how to handle various content types using regex, whilst the latter is quick, but not very secure, (pop-up hell).

there is a pure-java project, (Lobo), available, but it has some ways to go yet..

how old is the JVM at school?... :|
the code you use at home is the correct approach for managing OS specific MIME types...

while you can hack the JVM to launch an external app, it's inherently unstable and you're going to struggle to do so securely...
Most people would sooner die than think; in fact, they do so - Bertrand Russel
Tiza
Registered User
Posts: 1486
Joined: 01 Dec 2004, 02:00
Location: At your window
Contact:

Re: Java Help

Post by Tiza »

OK thanks do you have any code so my JAVA app opens a word document.... ?


Thanks
Image
I am a guy so please people stop sending me these shady pm's and start playing computer games or bodybuilding. Forums aren't a good place to get chicks the gym is...
Tiza
Registered User
Posts: 1486
Joined: 01 Dec 2004, 02:00
Location: At your window
Contact:

Re: Java Help

Post by Tiza »

HELP ANYONE ???
Image
I am a guy so please people stop sending me these shady pm's and start playing computer games or bodybuilding. Forums aren't a good place to get chicks the gym is...
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Java Help

Post by rustypup »

this is not the first time you've asked this question... after reviewing the prior thread, i'm concerned that you may be missing the point.

the process of executing native apps from within the JVM is well documented but discouraged.. purely from a stability POV ....

the java.awt.Dekstop API is there for that very reason... it relies on the local OS to manage the mime call, which is what you want.... you don't want the executing app to hang, which hangs the JVM and brings everything to a crashing halt until such time as the JVM's heap is consumed...
Most people would sooner die than think; in fact, they do so - Bertrand Russel
Tiza
Registered User
Posts: 1486
Joined: 01 Dec 2004, 02:00
Location: At your window
Contact:

Re: Java Help

Post by Tiza »

OK thanks for the help.

I just need to open a word document that I have already dragged into my project file.

I ave used te code before but can't seem to find it anywhere now.

I remember you say something like Runtime.something(cmd/c Help.doc) or something similar, any advice?

Thanks
Image
I am a guy so please people stop sending me these shady pm's and start playing computer games or bodybuilding. Forums aren't a good place to get chicks the gym is...
Tiza
Registered User
Posts: 1486
Joined: 01 Dec 2004, 02:00
Location: At your window
Contact:

Re: Java Help

Post by Tiza »

Hey

Sorry what library does this code use ???

java.awt.Desktop.getDesktop().mail(new java.net.URI("mailto:L-Dog@DE.com"));


THANKS
Image
I am a guy so please people stop sending me these shady pm's and start playing computer games or bodybuilding. Forums aren't a good place to get chicks the gym is...
Post Reply