Comments (6)
It may be that the CodeArea has focus, you will see the cursor flash, then the placeholder will not show.
The placeholder only shows if there is no text and it does not have focus.
from richtextfx.
It may be that the CodeArea has focus, you will see the cursor flash, then the placeholder will not show. The placeholder only shows if there is no text and it does not have focus.
Thank you very much for your reply, but in fact, I have created multiple CodeAreas, and I have confirmed that none of them have obtained focus or entered a cursor.
from richtextfx.
Could you then provide a small test program that demonstrates the problem, as it works for me ?
from richtextfx.
This is fxml:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.StackPane?>
<?import org.fxmisc.richtext.CodeArea?>
<?import javafx.scene.layout.HBox?>
<StackPane fx:id="sPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.potato.potatotool.controller.PaneWebshellDecode">
<HBox spacing="10">
<CodeArea fx:id="result1" prefWidth="300" prefHeight="300" style="-fx-background-color: red"/>
<CodeArea fx:id="result2" prefWidth="300" prefHeight="300"/>
<CodeArea fx:id="result3" prefWidth="300" prefHeight="300" style="-fx-background-color: blue"/>
</HBox>
</StackPane>
This is Controller:
package com.potato.potatotool.controller;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import org.fxmisc.richtext.CodeArea;
import java.io.IOException;
public class PaneWebshellDecode {
@FXML
private CodeArea result1;
@FXML
private CodeArea result2;
@FXML
private CodeArea result3;
@FXML
void initialize() throws IOException {
TextFlow placeholder = new TextFlow (new Text("myText"));
result1.setPlaceholder(placeholder, Pos.CENTER);
result2.setPlaceholder(placeholder, Pos.CENTER);
result3.setPlaceholder(placeholder, Pos.CENTER);
}
}
richtextfx v0.10.8 java11.0.12
I'm very sorry, it may be due to network reasons that we are unable to upload the rendering. In fact, three CodeAreas did not appear as placeholder strings.
from richtextfx.
Ok, have found a bug and will submit a fix .....
By the way:
- The same placeholder cannot be used on multiple areas at the same time, as a Node may only occur once in the scene graph.
- And
Text
does not have to be wrapped in aTextFlow
, just do:area.setPlaceholder( new Text("myText") );
from richtextfx.
Thank you for the quick fix! Appreciate it. 👍
from richtextfx.
Related Issues (20)
- Question: how I can use InlineCssTextField with multiple color and pattern text please HOT 3
- Question: codeArea.removeSelection delayed display HOT 1
- CodeArea seems to intercept the input method, preventing it from being passed to other TextFields.
- Remove null character at end of pasted string
- JDK8 project HOT 1
- Question: is it possible to disable scrolling to bottom on appending text? HOT 2
- Question: How to set background color for current line/paragraph using CSS? HOT 4
- Question: Is possible to detect when INSERT mode is used? HOT 16
- Question: How to make wave underline? HOT 4
- Question: What is the strategy to implement Highlight All for found matches for modifiable text? HOT 5
- Question: Getting font size of the CodeArea HOT 3
- Question: when to use StyleSpans? HOT 8
- Bug: Observer is not removed from richChanges() HOT 3
- Question: how to get real size of one span at position X? HOT 15
- Code building fails on Ubuntu HOT 2
- How to remove all styles from undo text? HOT 4
- How to convert absolute position to paragraph/column position? HOT 1
- Question: is textArea.getLength() equal to the number of Unicode code points HOT 5
- Bug: text area removes selection on text append HOT 10
- Selected color with alpha add extra colors HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richtextfx.