@@ -0,0 +1,3382 @@
+package org.fxmisc.richtext.demo;%0A%0Aimport javafx.application.Application;%0Aimport javafx.event.ActionEvent;%0Aimport javafx.geometry.Pos;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.control.Button;%0Aimport javafx.scene.control.TextField;%0Aimport javafx.scene.layout.BorderPane;%0Aimport javafx.scene.layout.VBox;%0Aimport javafx.stage.Stage;%0Aimport org.fxmisc.flowless.VirtualizedScrollPane;%0Aimport org.fxmisc.richtext.InlineCssTextArea;%0A%0Aimport java.util.function.Consumer;%0Aimport java.util.function.Function;%0A%0Apublic class ShowLineDemo extends Application %7B%0A%0A    public static final int MIN_LINE_INDEX = 0;%0A%0A    private class NumbersOnlyField extends TextField %7B%0A%0A        NumbersOnlyField() %7B%0A            super();%0A            setOnKeyTyped(ke -%3E %7B%0A                String keyEventText = ke.getCharacter();%0A                if (Character.isDigit(keyEventText.charAt(0))) %7B%0A                    if (getSelectedText().isEmpty()) %7B%0A                        appendText(keyEventText);%0A                    %7D else %7B%0A                        replaceText(getSelection(), keyEventText);%0A                    %7D%0A                %7D%0A                ke.consume();%0A            %7D);%0A        %7D%0A%0A        public int getTextAsInt() %7B%0A            String text = getText();%0A            if (text.isEmpty()) %7B%0A                setText(String.valueOf(MIN_LINE_INDEX));%0A                return MIN_LINE_INDEX;%0A            %7D else %7B%0A                return Integer.parseInt(text);%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A    private final NumbersOnlyField field = new NumbersOnlyField();%0A    %7B%0A        field.setPromptText(%22Input a number to indicate which line you want to show%22);%0A    %7D%0A%0A    @Override%0A    public void start(Stage primaryStage) throws Exception %7B%0A        StringBuilder sb = new StringBuilder();%0A        int max = 100;%0A        for (int i = 0; i %3C max; i++) %7B%0A            sb.append(%22Line Index: %22).append(i).append(%22%5Cn%22);%0A        %7D%0A        sb.append(%22Line Index: %22).append(max);%0A        InlineCssTextArea area = new InlineCssTextArea(sb.toString());%0A        VirtualizedScrollPane%3CInlineCssTextArea%3E vsPane = new VirtualizedScrollPane%3C%3E(area);%0A%0A        Function%3CInteger, Integer%3E clamp = i -%3E Math.max(0, Math.min(i, area.getLength() - 1));%0A        Button showInViewportButton = createButton(%22Show line somewhere in Viewport%22, ae -%3E %7B%0A            area.showParagraphInViewport(clamp.apply(field.getTextAsInt()));%0A        %7D);%0A        Button showAtViewportTopButton = createButton(%22Show line at top of viewport%22, ae -%3E %7B%0A            area.showParagraphAtTop(clamp.apply(field.getTextAsInt()));%0A        %7D);%0A        Button showAtViewportBottomButton = createButton(%22Show line at bottom of viewport%22, ae -%3E %7B%0A            area.showParagraphAtBottom(clamp.apply(field.getTextAsInt()));%0A        %7D);%0A%0A        VBox vbox = new VBox(field, showInViewportButton, showAtViewportTopButton, showAtViewportBottomButton);%0A        vbox.setAlignment(Pos.CENTER);%0A%0A        BorderPane root = new BorderPane();%0A        root.setCenter(vsPane);%0A        root.setBottom(vbox);%0A%0A        Scene scene = new Scene(root, 700, 500);%0A        primaryStage.setScene(scene);%0A        primaryStage.show();%0A%0A    %7D%0A%0A    private Button createButton(String text, Consumer%3CActionEvent%3E handler) %7B%0A        Button b = new Button(text);%0A        b.setOnAction(ae -%3E %7B%0A            handler.accept(ae);%0A            field.requestFocus();%0A        %7D);%0A        return b;%0A    %7D%0A%0A%7D%0A

Add demo for`show()` related methods