HTML Display

Progress reports and musings from the developers on the current gaming tools.

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
Blakey
Dragon
Posts: 778
Joined: Fri Mar 23, 2007 11:27 am
Location: Sussex, UK.

HTML Display

Post by Blakey »

Any Java experts out there know how to make a Java editor look like IE does?

For example, I stick the exact same piece of HTML into a Java Editor and get this:
Java frame
Java frame
java.jpg (101.73 KiB) Viewed 1361 times
And when it's displayed in IE it looks like this:
IE look.
IE look.
ie.jpg (214.68 KiB) Viewed 1361 times
Safari looks like this: Not as nice IMHO but at least it supports all the styles.
Safari
Safari
safari.jpg (178.04 KiB) Viewed 1361 times
I much prefer the IE display and can't figure out why the Java one doesn't seem to understand the style sheet properly.

Can anyone help?

Incidentally the Java fframe is taken straight out of a MapTool frame, but I get the exact same effect in my own Java program.

Blakey
The guy in the green hat.

bstrdsmkr
Cave Troll
Posts: 41
Joined: Sat Jun 05, 2010 8:58 pm

Re: HTML Display

Post by bstrdsmkr »

from what i understand JFrames only support a subset of html and css.
http://www.lmwcs.com/rptools/wiki/Supported_CSS_Styles
is a list of supported css styles. are you trying yo use any others? From a quick google, it looks like the only way to get full support is either to bundle a simple browser, or save your html to a file and call the user's default browser, both of which are pretty heavy handed.

Hope that helps!

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: HTML Display

Post by jfrazierjr »

bstrdsmkr wrote:from what i understand JFrames only support a subset of html and css.
http://www.lmwcs.com/rptools/wiki/Supported_CSS_Styles
is a list of supported css styles. are you trying yo use any others? From a quick google, it looks like the only way to get full support is either to bundle a simple browser, or save your html to a file and call the user's default browser, both of which are pretty heavy handed.

Hope that helps!
What he said... Java's html/css support is about 8-10 years out of date. Your only option would be to fake it by building html tables, parsing the data out for rewrite, and using other hacky type tricks to get alignment the way you want it.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
Blakey
Dragon
Posts: 778
Joined: Fri Mar 23, 2007 11:27 am
Location: Sussex, UK.

Re: HTML Display

Post by Blakey »

Cheers guys. I ended up hacking my program - I looked up the CSS sheets wizards are using to generate their monsters and then did search/replace on my HTML classes to add "style=" sections to each class to force the CSS onto the tags. This is what my program frame looks like now:
final.jpg
final.jpg (136.03 KiB) Viewed 1350 times
I'm pretty happy with that. Clear, readable and looks better than the default Java.

Cheers!
Blakey
The guy in the green hat.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: HTML Display

Post by jfrazierjr »

Blakey wrote:Cheers guys. I ended up hacking my program - I looked up the CSS sheets wizards are using to generate their monsters and then did search/replace on my HTML classes to add "style=" sections to each class to force the CSS onto the tags. This is what my program frame looks like now:
final.jpg
I'm pretty happy with that. Clear, readable and looks better than the default Java.

Cheers!
Blakey
If you want the level/role/XP part formatted the same, you would need to break up the bits and put into a table on the top line. Alternately, you "might" be able to use two span tags inside a div, one aligned left and the other aligned right. I would have to see the html you get back to be able to see how easy it would be to reformat...
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

Post Reply

Return to “Developer Notes”