Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:37:13+00:00 2026-06-13T16:37:13+00:00

If I do Right click on a text box in my JavaFX application the

  • 0

If I do Right click on a text box in my JavaFX application the menu items display as bold font. This happens in some text boxes. For example we have one login screen where menu item is displayed properly but in other screen its displaying in bold.

Note: I haven’t written any code for right click on text box, as i guess its an internal feature and it displays the usual cut, copy, paste, delete and select all.

How to avoid context menu showing as bold?

This is happening only when I am setting the CSS of label in front of text box as bold.

.label { -fx-font-weight:bold; }

One last thing is that these controls are generated dynamically. Its a popup containing Label, Textbox and a Button.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:37:14+00:00Added an answer on June 13, 2026 at 4:37 pm

    By setting

    .label { -fx-font-weight:bold; }
    

    and by loading this CSS to scene you are overriding the global default CSS selector for labels defined in caspian.css, and thus changing all font-weight properties to bold of all labels in the scene, the label of context menu as well.
    You should define your own CSS selector and apply it for desired labels only :

    #my-bold-label {
        -fx-font-weight:bold;
    }
    

    in java code:

    Label lbl = new Label("My bold text");
    lbl.setId("my-bold-label");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Text box validation not working Right now I have 5 text boxes
I am creating a Context Menu Strip once a Rich Text Box is right
In the WPF application below, you get a cut/copy/paste right-click menu when you right
I saw How to hide html source & disable right click and text copy?
My exe processes text documents and I want to be able to right click
I'd expect a right-click-context-menu-style pop-up menu to be a part of jQuery UI. But
Apparantly when users right-click in our WPF application, and they use the Windows Classic
How to prevent to copy & paste any text [using right click and also
I know by right clicking some text fields in Crystal Reports you can tell
Right now the code below tests for a blank text box. If it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.