Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

Rich Text Java Applet as Substitute for <TEXTAREA>? 19

Glowbead asks: "I'm trying to find a java applet that can be used instead of a textarea for use in a Content Management System I'm working on. I basically need something that will let someone who's in charge of managing content to do spot formating (bold, italic, underline, H1, etc) without the need to know any html tags. I've found one called edit-on Pro that looks like it will do the trick from Real Objects. It's a pretty slick little applet that seems to work well under Netscape 4.x, Mozilla, and IE. The only problems are that I've tried for close to a week to get in touch with the company, with no luck, and it's not Open Source. I've also seen a few that are Windows only (dll plugin based). I'd really like to find something like this that is cross platform (as edit-on is) and free (as in speech) so that I can modify it to my needs and so that the whole system could be released at some point in the future. Does anyone know of anything good for this purpose?"
This discussion has been archived. No new comments can be posted.

Rich Text Java Applet as Substitute for <TEXTAREA>?

Comments Filter:
  • by Anonymous Coward
    Yahoo's mechanism is a bunch of JavaScript controlling an ActiveX control that comes as a standard part of IE. (thus the lack of a security warning...)

    The input field itself is the ActiveX control, and the UI for rich manipulation is JavaScript.

    -JF
  • ...is like asking the Pope for advice on the proper use of RU-486.

    - A.P.

    --
    Forget Napster. Why not really break the law?

  • Can this be modded up a bit, so it can be seen? Also, I want to echo in on the request for an URL regarding this capability w/ activeHex
  • by ChiChiCuervo ( 2445 ) on Wednesday May 02, 2001 @08:54AM (#252769) Homepage

    This always happens to me... When ever i do research on a topic (or am about too), it comes up in Ask Slashdot... must have a mental connection with Cliff... oh well

    Anyway, here's what i've found (other than what's already been mentioned)

    FuzzCat [mycgiserver.com] -- it seems to work, but A) it's more full featured than i'm looking for and B) i can't seem to find the source code for it... :(

    HTML WYSIWYG Editor [siteexperts.com] -- This is a good tutorial on how to write a formatting editor with javascript and IE4+. I think i'm going to use this (combined with some tricks used by Yahoo mail...)

    Here r some others (from a german PHP list):

    http://www.mycgiserver.com/~fuzzcat/webfile/text/t ext.html [mycgiserver.com]

    http://www.secretgate.com/axadir/classic.html [secretgate.com]

    http://netword.secretgate.com/ [secretgate.com]

    http://www.kalbi.demon.co.uk/winsite/win.htm [demon.co.uk]

    http://home.earthlink.net/~hheister/ [earthlink.net]

  • by drig ( 5119 ) on Tuesday May 01, 2001 @03:04PM (#252770) Homepage Journal
    If you download the latest JDK, it'll come with a demo called "Stylepad". It uses the Swing text components (I'm not sure if you can use Swing). The demo seems to save to some binary format (apparently, it's a serialized java object), but there's probably some way to trick it into saving in HTML.

    -Dave
  • You've probably already got what you need, but Lotus Notes does non-relational DB stuff, and it looks good from the web. There's also a "rich text applet", which is a piece of Java, that allows you to do exactly what you're talking about. There's actually quite a few newspapers out there that use Notes for their web engine.

    On the plus side of commercial software, the server part runs on Linux.
  • by mmarcos ( 45149 ) on Tuesday May 01, 2001 @11:37AM (#252772)
    I looked into this in the past and could only find tools that allow you to format text already writtin in the tool. Text and images on the clipboard cannot be pasted in. Of course you can write an img src=... but that is not friendly for my population of content creators.
  • AFAIK, there's no rule in any HTML specification that says TEXTAREAs have to suck, is there? It seems like the most logical solution would be for the browsers to a) implement a quality text editor, or b) let the user choose an editor and embed a copy of it in the page. That would leave the standard on the page, and the fun customization on the user's end. Personally, I fear TEXTAREAs because they lack Autobackup (for when Netscape and IE decide to bite the dust), Search/Replace, Insert File, Save As, and other such goodies. I'd love to have xemacs or gnotepad embedded in my browser. This seems like the cleanest solution to me....
    ----
    "Here to discuss how the AOL merger will affect consumers is the CEO of AOL."
  • by ikekrull ( 59661 ) on Tuesday May 01, 2001 @03:19PM (#252774) Homepage
    You can write something like this in javascript/DHTML, since you have access to the current selection, and can rewrite parts of the document on the fly.

    NS 4.x wil never work this way, however. You can't modify anything in a rendered document except image sources in NS 4.x

    There are, as far as i know, no free Java components to do this easily.

    There may be commercial ones, and it probably wouldn't take much to write something simple yourself, but Java just sucks on most browsers other than IE (a sad state of affairs), and if youre going IE, then you might as well just use DHTML/Javascript.

    You then get the benefit of being able to use Mozilla as well, if it ever attains 'good, fast browser' status, but you should be very careful to write your javascript with this in mind.

    Netscape have given up on providing a decent browser, or even supporting their own browser with the DHTML content on their site, and the few people (i'm one of them) who use a Linux-only desktop probably prefer hacking HTML by hand anyway, so it most likely wouldn't surprise anyone if you went IE-only with this project.

  • by Chris Brewer ( 66818 ) on Tuesday May 01, 2001 @02:53PM (#252775) Journal
    Internet Explorer 5 and above has the DHTML editor built in which you can use. It's not java, but you can set up a bunch of icons of your choosing to control formatting (including bullets). It supports copy/paste, but not right-click menu.

    You could use the ocx version for IE4 if you needed to support that.

    However the big drawback is that it is IE only, so probably not good for internet, but ideal for intranet if IE is standard.
    --
  • by GreyyGuy ( 91753 ) on Tuesday May 01, 2001 @01:25PM (#252776)
    I've looked into this a little bit for a similar project I'm working on and didn't find anything I liked. The closest I've seen to something that looked really good was the way Yahoo! does their web email system. It looks like it is all in JavaScript and CSS, but it works well in IE. I haven't used Netscape on it, but it should work.

    I imagine it would not be legal to copy it verbatim (though I didn't look for any licensing info) but it shows that it can be done without an applet and could probably be reproduced.
  • Last year we were using a commercial content management software called Eprise, and with the latest version they switched from using IE-only IFRAMES/Javascript to a 3rd party product called Ektron eWebEdit...

    This is a multi-platform, customizable, programmable product. I don't know how much do they charge for it, but it looks like a good product for your purposes.

    You can find the product page at http://www.ektron.com/ [ektron.com]

  • Have a look at KFC [ring.gr.jp] (no chicken involved). It's a light weight AWT based framework for writing JDK 1.1.x compatible applets.

    And an HTML editor with highlighting is one sample applet!!! You'd just have to write something on the server side to lock/save the file.

  • Have a look at KFC

    Just out of curiosity, on which platform did you get this to do anything?

    I've tried IE and Netscape on Mac and Windows, and Netscape on Linux and FreeBSD, and none of the applets there worked at all. Mainly just a lot of big grey spaces. The most exciting thing was that Mac IE 5 eventually reports "A connection failure has occurred."

  • DHTML Lab (dhtmllab.com) had a tutorial on this awhile back. A full featured, cross-browser content editor in DHTML and Javascript, complete with realistic application interface. It produced compliant code in XML which could then be translated to HTML (whatever compliance you like) using server side processing (ASP, PHP, etc.).

    It may still be up there, as I recall it was an early project.
  • Unfortunately there exist no free editors that save into HTML. While Sun has such an API for doing this, it definitely will choke on the simplest things, like lists.

    I've heard of a proprietary package which does this, but this was long ago and I have no idea where to find this now.
  • The best cross-browser solution I've found for this is the Ekit applet available at http://www.hexidec.com/ekit.html [hexidec.com]. The source is available, so you can also use it to see how to use Java Swing to make a WYSIWYG HTML editor.

    One of the drawbacks here is that it needs Java 2, which many browsers don't support. There is a plug-in available from Sun, http://java.sun.com/products/plugin/ [sun.com], that can allow more browsers to support Java 2, but it is something that the user will need to be able to install--and I've found that depending on your audience, you may not be able to be sure they can do that.

    Another drawback is that, last I saw, it doesn't have much support for maintaining formatting when copying and pasting from other documents. If the user wants to be able to preserve formatting from a word processing document, you'll need to provide your own solution for allowing them to upload those documents to someplace where you can process them into HTML.
  • Try Ektron's [ektron.com] eWebEditPro product. We use it as part of a recently completed Vignette installation to allow clueless business users to enter text to templated web pages. It's a decent WYSIWYG editor (bolding, italics, H1-6, etc.) and it lets those few that know HTML switch to the source to edit directly. It's been a screaming success so far. Only problem - not open souce, but the license is reasonable (I think it cost a few hundred bucks).

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...