• Post Reply Bookmark Topic Watch Topic
  • New Topic

Aligning HTML text/images in JEditorPane  RSS feed

 
N D Fisher
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to create some simple HTML in a JEditorPane with an image aligned on the left, and the text cascading down the right of it - but it does not seem to work. The text I'm setting in the editor pane is simply '<img src="myimg.jpg" align="left">my text....etc'.

It seems that neither the 'align="left"' or 'align="right"' commands have any effect. Instead, it always defaults to 'align="bottom"'. It seems strange that aligning to top, middle, or bottom works - but not to left or right. Here's any example of how it looks: http://www.cafeaulait.org/slides/sd2000east/webclient/JNP2E0802.JPG

You can see the blue text 'Mastering Algorithms...' is aligned to the bottom of the image instead of flowing down the side.

Is there any fix for this?

Many thanks,

Nick

[ September 15, 2008: Message edited by: N D Fisher ]
[ September 15, 2008: Message edited by: N D Fisher ]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the same HTML work properly in a browser?
 
N D Fisher
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it works fine in a browser. I'm a full-time web developer, and regularly use align commands in Firefox and IE without any problems.

Here's a snippet of HTML which displays fine in browsers, but not the JEditorPane:




Nick
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!