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 7602613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:27:24+00:00 2026-05-30T23:27:24+00:00

I am encountering a problem loading an HTML file in an editor pane and

  • 0

I am encountering a problem loading an HTML file in an editor pane and displaying it. The code I am using is:

window_pane = new JEditorPane("file:///assets/www/index.html");

But that just gave some errors:

Exception in thread "main" java.io.FileNotFoundException: \assets\www\index.html (Het systeem kan het opgegeven pad niet vinden)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at javax.swing.JEditorPane.getStream(Unknown Source)
    at javax.swing.JEditorPane.setPage(Unknown Source)
    at javax.swing.JEditorPane.setPage(Unknown Source)
    at javax.swing.JEditorPane.<init>(Unknown Source)
    at nl.xedus.battlex.java.WebBrowser.<init>(WebBrowser.java:33)
    at nl.xedus.battlex.java.WebBrowser.main(WebBrowser.java:72)

ScreenShot:

enter image description here

Can anybody help please?

  • 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-05-30T23:27:25+00:00Added an answer on May 30, 2026 at 11:27 pm

    That looks like a relative path in your file URL. You need to use an absolute path. For resources bundled with your application you can get a URL like this:

    final String resourcePath = "foobar.html";
    URL resourceURL = Thread.currentThread().getContextClassLoader().getResource(resourcePath);
    JEditorPane editorPane = new JEditorPane(resourceURL);
    

    This assumes that there is an HTML file named ‘foobar.html’ at the root of your classpath. Extend the pseudocode to serve your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am encountering a problem when using LINQ in C#, I am constantly getting
I am encountering a problem using CFGRID with JQuery. Here are the sample codes
I'm encountering a problem generating my client and server code from wsdl. I've been
I'm new to JQuery (and JavaScript/AJAX in general) and am encountering a problem with
I am encountering a problem while extracting info from a database using php+mysql and
I'm encountering a problem with my database connection. I started with a new blank
I'm encountering a problem with the WinForm designer. I made a new UserControl, I
I'm using Backbone along with jQuery and jqGrid and encountering problem with binding the
Using the most recent build of imgbox , encountering the same problem I had
I am encountering a problem with string formatting while trying to get only the

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.