Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-08-2006, 11:46 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2006
Posts: 5
Unhappy how to link html files to java program


i have created project in java.now the problem is that i want to create html file for my project that contains some inf regarding my project.but i dont know the way to link this html file to my java program.
umar_bin_rashid is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 02-08-2006, 03:22 PM   #2 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: how to link html files to java program

do u wanna give a dload link or u wanna display the contents of that on screen....
Pathik is offline  
Old 02-08-2006, 03:40 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2006
Posts: 5
Default Re: how to link html files to java program

Quote:
Originally Posted by pathiks
do u wanna give a dload link or u wanna display the contents of that on screen....
i want to display the contents of that on screen.
umar_bin_rashid is offline  
Old 02-08-2006, 03:48 PM   #4 (permalink)
Human Spambot
 
Join Date: Nov 2004
Location: Madurai
Posts: 2,349
Default Re: how to link html files to java program

You will have to create a JPanel (remember vaguely about this...) with a JTextArea and JTextPane etc... Search for how to create a browser in Java - this will give you ideas of what to do...

Arun

Last edited by sakumar79; 02-08-2006 at 03:53 PM.
sakumar79 is offline  
Old 02-08-2006, 09:07 PM   #5 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2006
Posts: 5
Default Re: how to link html files to java program

Quote:
Originally Posted by sakumar79
You will have to create a JPanel (remember vaguely about this...) with a JTextArea and JTextPane etc... Search for how to create a browser in Java - this will give you ideas of what to do...

Arun
that way i know but it is very time consuming.cant i call microsoft IE from my java program
umar_bin_rashid is offline  
Old 03-08-2006, 12:53 AM   #6 (permalink)
Wise Old Owl
 
aadipa's Avatar
 
Join Date: Feb 2004
Location: Palghar, Mumbai
Posts: 1,000
Default Re: how to link html files to java program

Quote:
Originally Posted by umar_bin_rashid
that way i know but it is very time consuming.cant i call microsoft IE from my java program
Code:
Process process;
process = Runtime.getRuntime().exec("<any command you want>");
__________________
i generally prefer quality over quantity
1 aadi + 1 aadi = 1 full ;)
aadipa is offline  
Old 03-08-2006, 06:57 AM   #7 (permalink)
Human Spambot
 
Join Date: Nov 2004
Location: Madurai
Posts: 2,349
Default Re: how to link html files to java program

^^ But in this process, you will drop the OS-independence of the program.

Arun
sakumar79 is offline  
Old 03-08-2006, 11:29 AM   #8 (permalink)
Wise Old Owl
 
aadipa's Avatar
 
Join Date: Feb 2004
Location: Palghar, Mumbai
Posts: 1,000
Default Re: how to link html files to java program

the request was for directly starting Microsoft IE so is the code.

Runtime.exec() is the method to call external program, and thus it will not be OS independant.

What you can do is to ask for path to browser file while starting the program and then call that browser in exec() call.

You can pass url as command line parameter in exec() call.
__________________
i generally prefer quality over quantity
1 aadi + 1 aadi = 1 full ;)
aadipa is offline  
Old 04-08-2006, 05:32 PM   #9 (permalink)
In The Zone
 
rohan's Avatar
 
Join Date: Mar 2004
Location: Bangalore
Posts: 297
Default Re: how to link html files to java program

i think he wants to create a browser view within the Java applet like a widget.... hmm... maybe there is a way for it... coz i hate java
__________________
If there wasn't greed, we still would have been single-celled organisms.
rohan is offline  
Old 05-08-2006, 01:12 AM   #10 (permalink)
Wise Old Owl
 
aadipa's Avatar
 
Join Date: Feb 2004
Location: Palghar, Mumbai
Posts: 1,000
Default Re: how to link html files to java program

Quote:
Originally Posted by rohan
i think he wants to create a browser view within the Java applet like a widget.... hmm... maybe there is a way for it... coz i hate java
In that case, try to use JEditorPane from swing library.
Look here for more info about how to do that.
__________________
i generally prefer quality over quantity
1 aadi + 1 aadi = 1 full ;)
aadipa is offline  
Old 05-08-2006, 12:39 PM   #11 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2006
Posts: 5
Exclamation Re: how to link html files to java program

Quote:
Originally Posted by aadipa
the request was for directly starting Microsoft IE so is the code.

Runtime.exec() is the method to call external program, and thus it will not be OS independant.

What you can do is to ask for path to browser file while starting the program and then call that browser in exec() call.

You can pass url as command line parameter in exec() call.
my actual problem is that-------
i have created one html file.
now i want to open that html file in web browser on click event of a button in java.
plz reply........
umar_bin_rashid is offline  
Old 05-08-2006, 02:04 PM   #12 (permalink)
In The Zone
 
rohan's Avatar
 
Join Date: Mar 2004
Location: Bangalore
Posts: 297
Default Re: how to link html files to java program

do as he said: Runtime.exec(path to html filename)

also, don't forget to put it in the appropriate event... btw.. this will open the html file in the default web browser on the system. Or maybe it opens it with a text editor(if ur user has set it up that way... web designers generally do that )
__________________
If there wasn't greed, we still would have been single-celled organisms.
rohan is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


 
Latest Threads
- by icebags
- by clinton
- by ico
- by Charan
- by gohan89

Advertisement




All times are GMT +5.5. The time now is 11:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2