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

  • SEARCH
  • Home
  • 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 7405943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:28:50+00:00 2026-05-29T05:28:50+00:00

We are using JavaFX’s TextArea control in our application, and trying to integrate it

  • 0

We are using JavaFX’s TextArea control in our application, and trying to integrate it with Jazzy Spell Check API – as in, when a user enters a wrong word that is not in the dictionary, such word would be highlighted.

Is there a way to highlight a word in said control? I’ve seen no options for that in the JavaDocs, so if someone could suggest an approach?

It could be possible, I guess, to use the HTMLEditor component and color the words diferently with <font face="red=>wrongWord</font>. This, however, brings a whole lot of different problems with the spell checking, such as the html tags and words count.

  • 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-29T05:28:51+00:00Added an answer on May 29, 2026 at 5:28 am

    The JavaFX TextArea control (as of 2.0.2) does not support rich text editing where text styles (fonts, etc) are mixed.

    You can highlight contiguous strings of characters in the TextArea by manipulating the TextArea’s selectRange, as in the following example:

    public class TextHighlight extends Application {
      public static void main(String[] args) { Application.launch(args); }
      @Override public void start(Stage stage) {
        final TextArea text = new TextArea("Here is some textz to highlight");
        text.setStyle("-fx-highlight-fill: lightgray; -fx-highlight-text-fill: firebrick; -fx-font-size: 20px;");
        text.setEditable(false);
        text.addEventFilter(MouseEvent.ANY, new EventHandler<MouseEvent>() {
          @Override public void handle(MouseEvent t) { t.consume(); }
        });
    
        stage.setScene(new Scene(text));
        stage.show();
    
        Platform.runLater(new Runnable() {
          @Override public void run() { text.selectRange(13, 18); }
        });
      }
    }
    

    You could use the above code as a basis to switch the TextArea to read-only mode while spell checking is happening. Implement prompting to find and fix each word in turn until the spell check is complete. Perform the prompting in a separate dialog or panel. The Jazzy demo seems to work this way http://jazzy.sourceforge.net/demo.html, so it should be fairly easy to convert its Swing UI to JavaFX.


    Alternately, you could use a JavaFX WebView control to wrap any of the many javascript/html based spell checkers (e.g. http://www.javascriptspellcheck.com/) using a technique similar to what is demonstrated here: http://jewelsea.wordpress.com/2011/12/11/codemirror-based-code-editor-for-javafx/.

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

Sidebar

Related Questions

I'm trying to upload a file using JavaFX using the HttpRequest. For this purpose
Using JavaFX 1.2 I am trying to get custom icons on my app and
In SOAP Client application. I am using javax.xml.soap api. I am getting the soap
I have developed application in Netbeans IDE 6.9 Using javafx Script based Application. i
I'm developing a JavaFx 2.0 application using Netbeans 7. The main application references another
I am trying to implement a custom tooltip using the javafx.stage.Popup . The sample
We are using GroovyFX in our project, to build our user interfaces. It already
I'm moving an application from using javax.help's browser to the user's desktop web browser,
At the moment I'm using JavaFX only for fun and learning it. What I
I am using javax.scripting to add support for running arbitrary user-uploaded JavaScripts on 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.