Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8817683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:54:34+00:00 2026-06-14T04:54:34+00:00

I have to browse Html files in java windows application software . For it

  • 0

I have to browse Html files in java windows application software . For it i am using JEditorPane control but its not supporting some tags of HTML and formatting is disturbing in JEditorPane. I have searched on net and net is suggesting me to use JavaFXApplication control for it . In C# there is a control WebBrowser that displays the html file in the same format easily . Is it possible in java too to display the html files with all supporting tags .
Can you suggest me the control or something wrong in my code.I am using the following code.

 try
 { 
  File htmlfile= new File("path of the html file");
  JEditorPane htmlPane= new JEditorPane();
  htmlPane.setEditable(false);
  htmlPane.setContentType("text/html");
  htmlPane.setPage(htmlfile.toURI().toURL());
  JScrollPane jsp= new JScrollPane(htmlPane);
  add(jsp);
  }

  catch(Exception ex)
   {


    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:54:35+00:00Added an answer on June 14, 2026 at 4:54 am

    If I understand your question correctly, you are trying to view the HTML SOURCE and not trying to implement a web browser.

    If that’s the case you can use JavaFX’s HTML editor assuming you are using Java 6 with JavaFX OR Java 7 which includes JavaFX

    Here’s a short sample of using the javafx package using the JFXPanel and HTMLEditor:

    public class JavaFXDemo {
    
        private static void initAndShowGUI() {
            JFrame frame = new JFrame("HTML Editor");
            final JFXPanel fxPanel = new JFXPanel();
            frame.add(fxPanel);
            frame.setSize(600, 400);
            frame.setVisible(true);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            Platform.runLater(new Runnable() {
                @Override
                public void run() {
                    final HTMLEditor htmlEditor = new HTMLEditor();
                    Scene scene = new Scene(htmlEditor);
                    fxPanel.setScene(scene);
                }
            });
        }
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    initAndShowGUI();
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website with separate HTML files (actually .shtml, but this is unimportant
I have a winforms TreeView control that allows you to browse an object hierarchy.
I have installed apache on my server however I can not browse my website
I have developed a Java EE web application. This application allows a user to
I have Java webserver (no standard software ... self written) . Everything seems to
I have developed an applet java with Eclipse, which is included in MyPage.html. I
I have jsp file: <%@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8%> <%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core%>
I made a jsf project and have the following example from http://docs.openlayers.org/library/introduction.html but as
I have following html file (1.html) and once I open it in my browser
Suppose we have this example: http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html with source code available here: http://code.google.com/p/myandroidwidgets/source/browse/trunk/Phonebook/src/com/abeanie/ How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.