display non-editable text in JavaFX with different CSS styles - css

Some text display in resizable AnchorPane. It may be Label or Text (not editable). In text may be bold (fat) words, for example. How to implement it? Text in Label or Text may be only in one style. When I link bold word with other text as two different Labels, I have problem with text wrapping (.setWrap(true)).

I found answer) TextFlow use for this.
https://docs.oracle.com/javase/8/javafx/user-interface-tutorial/text-settings.htm#CHDEEAFG

Related

How to paste the text with the same property in Actionscript 3?

I want to paste the text with the same height,width,color etc (i.e same as the time of copying the text).
I am using a textArea where i am adding text and also changing the color,font,size of the text by using style but if i am coping the text from textArea and pasting them then i am getting the text with default font style (Only changing heights are coming).
I have attached the image where you can see the difference
So anybody have an idea how to solve this problem ?
Maybe you can use a TextFlow and TextConverter with the methods export and importToFlow to use and TextConverter.TEXT_FIELD_HTML_FORMAT to get the format with the style attributes

Is it possible to put different colors for text in multiple line textbox

I have one text box with multiple line option. Now i want type the words inside the text box with different font-size and different colors. Is it possible?
it's not possble.. you can use a WYSWYG editor, like http://nicedit.com/

In flex how can someone add both bold and border?

I am trying to make a text area in flex 4.5. The problem is i need some part of it as bold not all. Also i need border.
A simple code is
<s:TextArea text="Text here1 Text here2">
By default s:TextArea contain border but I cant bold only one part of text that is "text here1"
If I try to use mx:TextArea Then I cant add border to it.
Please if anyone can help over how to add border along with if i can make only a part of text as bold or of different color etc.
Why can't you add a border to mxTextArea? There are a couple of ways:
specify borderStyle css property;
write a skin class, which draws a border and background you need, and assign it to borderSkin css property;
draw a 3x3 graphic skin and assign it to borderSkin css property.
Place a border container around the control
Use the textFlow property instead of the text property and you will be able to use rich text (bold, italics and so on).
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/TextFlow.html

Flex text selection: does it have to be white on black?

When you select text in a Text or Label or TextArea (or other) control in a Flex application, the selection is shown in white text on a black background. Always.
I have a request to change that — and it seems to be a simple enough thing to want — but I can't find a style (or property) anywhere that permits that. Any ideas out there about how to do this, or reasons why it definitively can't be done?
Change TextField selection color in AS3
http://ericlin2.tripod.com/select/selectt.html

Ghost/translucent caption inside text input?

First, what does one call the ghost caption that appears in a text edit if that edit has no real text?
Second, has anyone invented that particular wheel for Flex text components?
Thanks
It's called a Watermark.
I'm not an expert on Flex but here is one example:
http://labs.flexperiments.nl/writing-components-in-flex-part-2/

Resources