How to display a HTML file (in browser window) from Java Program...?

Reply

Join Date: Sep 2004
Posts: 55
Reputation: apcxpc is an unknown quantity at this point 
Solved Threads: 0
apcxpc's Avatar
apcxpc apcxpc is offline Offline
Junior Poster in Training

How to display a HTML file (in browser window) from Java Program...?

 
0
  #1
Dec 8th, 2004
'ellos

So I'm making a Hangman game, and for the sake of completeness I want to have a HELP feature. When the Help button is clicked, a browser window should open up (not *within* the game frame... but just generally) and display the HTML Help file. How do I do this?

So I have a full GUI, with a HELP button (a JButton) with an added Action Listener defined as follows:
(this is actually an inner class within another GUI class)

HelpListener implements ActionListener{
public void actionPerformed(ActionEvent evt){
//...insert code here, that will open up a browser window displaying a HTML help file (containing Hangman Help information)
}
}


Any help would be much appreciated.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 55
Reputation: apcxpc is an unknown quantity at this point 
Solved Threads: 0
apcxpc's Avatar
apcxpc apcxpc is offline Offline
Junior Poster in Training

Re: How to display a HTML file (in browser window) from Java Program...?

 
0
  #2
Dec 8th, 2004
Actually, to display either a HTML or text file in a browser window ...OR... just a text file in like Notepad or something.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: How to display a HTML file (in browser window) from Java Program...?

 
0
  #3
Dec 8th, 2004
You should be using a dialog box or a new frame ( as you like ) with a JEditorPane in it .... JEditorPane can display html/rich text format contents ... you can use the methods ... read or setText or setPage of JEditorPane to show the respective content.

For further information .. consult java api for javax.swing.JEditorPane
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC