jeditorpane

Is there a good drop-in replacement for Java's JEditorPane?

I'm not happy with the rendering of HTML by Swing's JEditorPane. In particular bullets for unordered lists are hideous. Customising the rendering seems extremely difficult. Therefore I'm looking for a replacement with better HTML rendering. Does this exist? (I asked Google, and found nothing except a promising dead link). ...

Does JEditorPane have Charset problems when showing HTML?

I have the following code: import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.ScrollPaneConstants; public class ScratchPad { public static void main(String args[]) throws Exception { String html ="<html>"+ "<head>"+ "<meta http-equiv=\"Content-Type\" content=\"tex...

auto scolling of JEditorPane

I am using a JEditorPane as an editor to write comments in my application. The content type is set "text/plain". When I am writing text in it and the text fills the available space and I go on typing, the text is not moving upward to show the cursor. So I dont know where I am typing and what I am typing since it would be visible. Could ...

JEditorPane inside JScrollPane not resizing as needed

Hai, I am implementing a Comment box facility in my application which user can resize using mouse. This comment box contains a scrollpane which instead contains a JEditorPane in which user can insert comment. I have added the editor pane inside a scroll pane for the following reason: auto scolling of jeditorpane When the user resizes ...

How do I get a JEditorPane to highlight the full width of a line (not just the text)?

I'm trying to get a JEditorPane to highlight the full width of a displayed line. All the examples I've tried only highlight the textual content. For example if I have content such as this: --------------------------------- |Here is some text | |some more text | --------------------------------- withi...

showing images on jeditorpane (java swing)

I have a JEditorPane created by this way: JEditorPane pane = new JEditorPane("text/html", "<font face='Arial'>" + my_text_to_show + "<img src='/root/img.gif'/>" + "</font>"); I put this pane on a JFrame. Text is shown correctly, but I can't see the picture, there is only a square indicating that there should be an image (i.e.: "broke...

Using JEditorPane and its setPage method

I have an editor pane which displays an HTML file. When I ask it to do it once, it displays the HTML file fine. I then make changes to my HTML file and use the setPage method so that it prints the updated HTML file but it doesn't do this even though the HTML file is changed. Is this a problem with the Editor pane or is there something w...

How can I change the color of a particular element of a HTMLDocument in a JEditorPane?

I basically want to implement changing the color of the links when I hover over them. The HyperlinkEvent that is triggered when I mouse over the link hands me the HTML element, but it won't let me set any style attributes on it, and I can't figure out how to get the elements that do have settable attributes. ...

How can I handle custom tags in a Java HTMLDocument?

I have a swing client that renders HTML through the use of the JEditorPane and HTMLDocument classes. The problem I have is that I want to be able to define an area of the document as a container for some text that will be retrieved at a later date, and then use document.setInnerHTML(element, data); to swap out the place-holder content...

Java Swing custom text JEditorPane

I have a list of Objects (the model) that are constantly appended to (similar to a log file) and I'd like to display as rich text in a JEditorPane (the view). How can I glue them together? http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#document doesn't seem to give enough information to use. ...

scrollPane remains gray randomly when it should display editorPane (html)

For some reason my HTML page is not appearing 100% on screen when it should, it looks like a timing issue to me. If I remove scrollpane and use just EditorPane it works ok. What kind of code should I add below to force java applet screen to redraw/refresh and can I somehow wait until all images were really loaded ok? Currently images a...

How do you set the tab size in a JEditorPane?

A JTextArea's tab size can easily be set using setTabSize(int). Is there a similar way to do it with a JEditorPane? Right now, text with tabs in my pane looks like: if (stuff){ more stuff; } And, I'd prefer a much smaller tab stop: if (stuff){ more stuff; } ...

What JEditorPane event should I create a listener for?

Suppose I have a JEditorPane in a JPanel. I want to be able to execute a callback each time the user enters/pastes text in the JEditorPane component. What type of listener should I create? ...

Selecting elements in a JEditorPane

I'm creating a Java application where the user can search through a list of objects, which are then displayed in a JEditorPane window using a dynamically generated table whose size varies by the amount of results returned. I then want to allow the user to select and edit the objects. (The Java objects, not the HTML code) Is this feasibl...

How to convert from a mouse position to a character position in a JEditorPane in Java Swing

I'm currently trying to solve a problem where I need to find the position in a piece of text in a JEditorPane based on where the mouse was clicked. Basically, when the user right-clicks over a word I need to find out what the word is. To do this I need to find out which position in the text the user has clicked on. I know I can easily ...

displaying links in java's JTextPane without html

I need to take text from a source as plain text and display it in a JTextPane or JEditorPane. The source text is not HTML but will contain URLs between square brackets which need to be displayed and function as hyperlinks. I've considered setting the pane's content type to text/html and surounding the url in html tags but that ends up i...

[swing] hyperlinks in JEditorPane in a JTable

I swear... i hope this is the last question I have to ask like this, but I'm about to go crazy. I've got a JTable using a custom TableCellRenderer which uses a JEditorPane to display html in the individual cells of the JTable. How do I process clicking on the links displayed in the JEditorPane? I know about HyperlinkListener but no mou...

Displaying XHTML in Swing (JEditorPane)

I'm writing a Java application with GUI using Swing. One of the GUI components is a JEditorPane that renders HTML. All the rendering is fine except that it shows in the first line the XML header: ?xml version="1.0" encoding="UTF-8" standalone="no"?> I've googled a little bit and I've found the same question here and there, but never any ...

Is there a way to attatch a css file to a jEditorPane?

Simple enough question: I have a string containing HTML that is being handed off to a JEditorPane for user consumption. Can I attach a CSS file (or string containing CSS rules) to allow for more specific styling of the text? ...

How to trigger a hyperlink using a keystroke in a Swing JEditorPane

Hi all, I'm trying to fire hyperlinks in a JEditorPane using the "Enter" keystroke. So that the hyperlink (if any) under the caret will fire rather than having to click with the mouse. Any help would be appreciated. ...