Giter Club home page Giter Club logo

Comments (4)

Jugen avatar Jugen commented on June 24, 2024

See the following CSS in the Wiki

-rtfx-underline-color: red;
-rtfx-underline-wave-radius: 2;
-rtfx-underline-width: 1;

from richtextfx.

PavelTurk avatar PavelTurk commented on June 24, 2024

@Jugen I am trying to make text waved, but something doesn't work. It seems that code doesn't react to rtfx-underline-wave-radius and -rtfx-underline-offset at all. This is my code:

public class JavaFxTest7 extends Application {

    @Override
    public void start(Stage stage) {
        CodeArea codeArea = new CodeArea("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
        codeArea.setWrapText(true);
        var addButton = new Button("Add");
        var removeButton = new Button("Remove");
        Scene scene = new Scene(new VBox(codeArea, addButton, removeButton), 600, 200);
        scene.getStylesheets().add(XMLEditorDemo.class.getResource("test7.css").toExternalForm());
        stage.setScene(scene);
        stage.show();

        var newStyles = new StyleSpansBuilder<Collection<String>>();
        newStyles.add(Collections.singleton("misspelled"), 5);
        codeArea.setStyleSpans(6, newStyles.create());
    }

    public static void main(String[] args) {
        launch();
    }
}

And CSS:

.misspelled {
     -rtfx-underline-color: cyan;
    -rtfx-underline-wave-radius: 2;
    -rtfx-underline-width: 1;
    -rtfx-underline-offset: 10;
}

And result:

Screenshot from 2024-05-22 12-46-00

from richtextfx.

Jugen avatar Jugen commented on June 24, 2024

I tried your demo changing one line and it worked for me.

scene.getStylesheets().add(XMLEditorDemo.class.getResource("test7.css").toExternalForm());

Where I changed XMLEditorDemo.class to JavaFxTest7.class

from richtextfx.

PavelTurk avatar PavelTurk commented on June 24, 2024

@Jugen Yes, my fault, I used 0.10.9 version in my test project. The code I provided above works only with 0.11.0+

from richtextfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.