Skip to content

Latest commit

 

History

History
69 lines (41 loc) · 2.91 KB

README.md

File metadata and controls

69 lines (41 loc) · 2.91 KB

Demos

Note: This page does not show all the demos in the package. Follow the instructions below to see them all.

Table of Contents

Instructions for running demos

  1. Clone the repository: git clone https://www.github.com/FXMisc/RichTextFX.git
  2. Checkout the latest release version: git checkout tagName where tagName is the latest release tag (use git tag to get a list of available tags, and use the last one)
  3. See the list of demos using a gradle task ./gradlew demos
  4. Run a demo using a gradle task: ./gradlew [Demo Name]

(For Windows users, replace ./gradlew with gradlew.bat in the above commands)

Structure of the Demos package

  • Each runnable demo class that extends Application ends in the suffix: "Demo"
  • If a demo requires additional classes that should not be nested, the demo and its helper classes appear in their own package named after the demo (e.g. RichTextDemo is found in the richtext package)

Rich-text editor

Source Code: RichTextDemo.java

Screenshot of the RichText demo

Automatic highlighting of Java keywords

Source Code:

JavaKeywordsDemo.java

JavaKeywordsAsyncDemo.java

The former computes highlighting on the JavaFX application thread, while the latter computes highlighting on a background thread.

Screenshot of the JavaKeywords demo

XML Editor

Similar to the Java Keywords demo above, this demo highlights XML syntax. Courtesy of @cemartins.

Source Code: XMLEditorDemo.java

Screenshot of the XML Editor demo

Multiple Carets and Selections

Source Code: MultiCaretAndSelectionDemo.java

Screenshot of the Multiple Carets and Selections demo

Custom tooltips

When the mouse pauses over the text area, you can get index of the character under the mouse. This allows you to implement, for example, custom tooltips whose content depends on the text under the mouse.

Source Code: TooltipDemo.java

Screenshot of the Tooltip demo