Is it possible to paint a background for a text in Javafx 8 color?

Hello

We are currently developing an application where the user matter a text that is then analyzed for specific keywords. These keywords should then be highlighted in the text so that the user can easily see which words have been found.

Now with Java 8, we want to use the new TextFlow class for this. I know that I can easily change the font of the words that have been identified, but it would also be nice if I could add a background color for a Visual scanning even easier text. Anyway is how to achieve this using the text class? I know that I could also add a label to the TextFlow, however that would break the flow of the text because sometimes we should also highlight the parts of the text, and that the text extends beyond the end of the line of the linkebreaks will be just hideous.

I already thought to subclass the text and the background, but simply do not know where I have to change the way the rendering takes place.

Advice would be appreciated

OK, for someone fall on this google search: after a lot of digging, I found that the only way to add this feature requires subclassing the non-public API NGText and adding the feature in the renderContent2D method. Unfortunately however the method impl_createPeer in the text is final, while we could add the functionality by subclassing the text and NGText, is not possible to actually use it, see post https://javafx-jira.kenai.com/browse/RT-35801

That's why I opened a ticket at Jira requesting such a feature: https://javafx-jira.kenai.com/browse/RT-35822

Tags: Java

Similar Questions

  • Is it possible to write a script for underlined text export to PDF?

    When I make changes in the financial document, I must emphasize this purpose to show what I edit, these underscore was called "markup". And then print (paper version) and gen (PDF) of the amendment, which means I have to print and gen text underlined (or called markup text) after modification.

    sample PIC:

    back markup.jpg

    If:

    Customer requires a new version of the markup, which means I have to change the last beacon color (color of the underline to the last amendments) in 'back' and then make new 'red' as this markup:

    red markup.jpg

    What I want:

    is it possible to write a script for printing and gen only markup in the document text all open

    and I want two versions

    (1) all text markup gen no matter the color of the underline

    (2) the red color of the markup text gen

    Thank you!

    Hi HarveyLiu,

    Why, you ask? It will export the pages who pointed out the text.

    var doc = app.documents;
    app.findTextPreferences = null;
    app.findTextPreferences.underline = true;
    for(var i=0;i
    

    Kind regards

    Cognet

  • Is it possible to create the formatting for the text box option in Oracle Apex 4.2?

    Hi all

    "I'm trying to create the same form that" ""form DISCUSSION SATRT ORACLE ' and I wanted to know if it is possible to create options for formatting that includes font family, size, indent, style etc,. as shown in the picture.

    Oracle version: 4.2

    DB version: 11.2 g

    .APEX_Question.jpg

    Kind regards.

    Hello

    Use Rich Text Editor Item in the choice of an element on the page apex. It has a few modes, see mode that suits you.

    -Sunil Bhatia

  • White background for the text? (Win PrE9)

    Hi, is it possible to change the default "Web" titles in PrE9 of the black to white? Or do you need to draw a white rectangle?

    Thank you.

    Steve

    Draw a white rectangle background is probably the simplest solution.

    Otherwise, you can put the securities on a higher video track and put a regular white clip on the video track below them.

  • Is it possible to pin a background image for (android) Tablet, that it doesn't matter what I do

    Is it possible to pin a background image for (android) Tablet, that it doesn't matter what I do

    Hello

    I believe you are trying to locate the image in the layout of tablet or phone.

    Due to lack of support on some browsers and Smartphones, pinning is disabled in Muse for Tablet and smartphone layouts.

    You can see this feature in future versions of Adobe Muse.

    You can use the scroll effect to achieve this as a solution.

    Select your items you want "pinned" and open your scrolling check Motion Control Panel the check box for the movement and the value of all the values to zero.

    Here is the screenshot for help.

    Concerning

    Vivek

  • Black background for Google

    Hi, you all! Since I have updated at 12.10, when using Firefox, I get a black/brown background for Google. I would like to know how to return to the classic Google homepage. Thank you!

    You use code in userContent.css or extensions like Stylish?

    It is possible that an extension of Ubuntu is the cause.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the start safe mode window or make changes.
  • How to get other themes start screen and backgrounds for Windows 8?

    Former title: how to change windows 8 start wallpaper?

    Hello

    How can I change background menu stars and their in windows 8? I know that there are some model in customize / splash screen. but I want other do and background

    Hey Amir,

    Welcome to the Microsoft Community Forums and thanks for your post about it.

    Want to know where you can get the other start screen themes and background for Windows 8 outside the themes and background images already present images in Windows 8 by default.

    Let me inform you that we will not be able to add additional themes and backgrounds for the splash screen in Windows 8. However, it is possible for the desktop interface. If you want to add backgrounds and additional desktop themes, you can visit these links and then download your favorite themes and background images.

    For desktop themes:

    http://Windows.Microsoft.com/en-us/Windows/themes

    For wallpapers

    http://Windows.Microsoft.com/en-us/Windows/wallpaper

    For more information, you can also take a look at this link:

    Customize your PC

     

    http://Windows.Microsoft.com/en-us/Windows/personalization-Gallery

    Hope this information is useful. Please get back to us, if you still have questions about the present. You can publish all your queries related to Windows on Microsoft Community Forum and we will be happy to help you.

  • Run in the background for more than 3 minutes?

    Hello

    My application is a timer-app. It works very well for 3 minutes in the background. If I put it on five minutes, it doesn't work (in the background) for 3 minutes, then it stops. (it continues when I open the app again).

    In my view, there is a 'window' of 10 minutes before, but now it's only 3? Is it possible to use beginBackgroundTaskWithExpirationHandler or something like that to ask for more time?

    Apple allows only long substantive events for certain types of applications, for example background audio apps, as you have noticed.

    This kind of situation would be better served with a local notification.

  • Is it possible to change the background color of some options in the menu drop-down

    Is is possible to change the background color of some options in a drop-down list?
    For example, in the list below, I would like to than the background color yellow for Jason, John, and Roger:

    Heather
    Jason
    John
    Keith
    Linda
    Roger

    Hello

    One method is to use jQuery.
    Examples
    http://Apex.Oracle.com/pls/OTN/f?p=40323:54

    I have this on HTML page header

    
    

    This could help how to install jQuery on Apex
    http://www.oracleapplicationexpress.com/tutorials/66

    Or you can just load the Google by adding this also to HTML header or a page template

    
    
    

    BR, Jari

  • Possible to restart some background process?

    I recently had a newbie-accident: typed "stop immediately" on production instead of test db db. After a few seconds, I realized my mistake and abandoned shutdown.
    Alertlog file is:
    Stop background QMNC process
    Stop background CJQ0 process
    Stop background MMNL process
    MMON background process stop

    Database runs normally for a few days, except that none of the planned work has begun.

    Is it possible to restart the background process without restarting the database?

    No, closing databases until the end and start it.

  • Is it possible to play different sounds for the emails and instant messages?

    Hello

    I was wondering if it was possible to play different sounds for the emails and instant messages. I use Thunderbird quite often with emails and instant messages imported from Gtalk.

    I think it would be very convenient to be able to distinguish the two sounds, because they do not involve the same things.

    Thank you very much.

    Olivier Hubert.

    There are only six modules of cat, three of them are on notifications. Choose the one you think will do the job for you. https://addons.Mozilla.org/en-us/Thunderbird/Extensions/chat/?sort=popular

  • Hi, my Firefox 8 comes to be automatically updated and I nowhave a black background for toolbars, which makes it very difficult for me to read, how to change this back to what I had before?

    Toolbars used to have ordinary white background with black text but not I have a black background with a black writing made only to stand out a bit by a blur of white around the typography which is not enough to make it easy for me to read.

    Thank you.

    https://support.Mozilla.com/en-us/questions/838035

  • Is it possible to exchange a macbook for a macbook air?

    I want to know if its possible to Exchange my Macbook for a Macbook air free or not free because when I download something on the internet for mac and I have to open the download file, that it says mount failed or it cannot read the file, ITS A DMG FILE NOT A EXE also most of the things that I download are for other versions of mac and I'm trying to update my mac by clicking on the icon Apple and update, then yes also something also won't work as when I go to a website like math splash because his homework and I can't do it on my mac, I'd use my windows but I love my mac because that his laptop and also I feel that my mac is no longer supported for nothing I feel like that because I have an older version of itunes this setting to day can't because it says it cannot connect to the itunes server then Yes please answer and here are the details of my mac: Version 10.4.11 model identifier 2.1 Build 8S 2167 then Yes please please please please! answer so I don't have to get an OTHER COMPUTER im my house thank you and please answer!

    Apple does not have the times. If the computer is new and within 14 days from the date of purchase, then you can return it for an Exchange. It will probably not be free. However, you must understand that the problem you described is not caused by the model of computer you have, and it will not fix another computer or another. Given the age of your model, the best you can expect is for sale on eBay, although there are retailers such as Expercom.com which will give you something in trade. But for those who have it won't be much.

    For the model that you have you need to back up your files, the boot from your OS X DVD, erase the drive, then reinstall OS X and also far that you can improve it - which is probably the leopard to snow you can buy on the Apple Online Store for $19.00 plus taxes and shipping.

  • Is Tecra A7 - possible to use this modem for fax purposes

    As long as Tecra A7 has a modem to connect to a telephone line, is it possible to use this modem for fax purposes?

    Hello

    Check the user manual.
    It is said:
    The computer contains a MDC, allowing data and fax communication.
    It supports ITU - T V.90. Transfer rates are and 14,400 bps FAX transmission.

    The modem controller features:
    …
    …
    For fax:
    V.34, V.17, V.29, V.27, and V.21 channel 2
    V253 fax class 1

    Seems that he supports the FAX feature

  • is it possible to set the background color of a table or chart to be transparent?

    is it possible to set the background color of a table or chart to be transparent?

    Thank you

    Yes.

    Select tools palette (view > tool palette) and set the background of the graph as well as the control in transperent.

Maybe you are looking for