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 8080791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:31:16+00:00 2026-06-05T16:31:16+00:00

How can I remove the small expand effect when I click on a JavaFX

  • 0

How can I remove the small expand effect when I click on a JavaFX button? And also how can I make it work like an menu button (when I press it to remain in focused state untill I press another “menu” button). Is there a way to group nodes into the same focus?

  • 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-05T16:31:18+00:00Added an answer on June 5, 2026 at 4:31 pm

    Three questions for the price of one 😉

    How can I remove the small expand effect when I click on a JavaFX button?

    When you click the button it has focus, when it has focus, it is surrounded by the focus ring, which makes it slightly larger. This effect is triggered via css.

    Default css is in caspian.css found in jfxrt.jar in your JavaFX runtime install.
    Relevant extract is here:

    .button {
        -fx-skin: "com.sun.javafx.scene.control.skin.ButtonSkin";
        -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
        -fx-background-insets: 0 0 -1 0, 0, 1, 2;
        -fx-background-radius: 5, 5, 4, 3;
    

    …
    }

    .button:focused {
        -fx-color: -fx-focused-base;
        -fx-background-color: -fx-focus-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
        -fx-background-insets: -1.4, 0, 1, 2;
        -fx-background-radius:  6.4, 5, 4, 3;
    }
    

    To remove the slight expansion effect, create your own stylesheet. In your stylesheet assign that to your scene and set the background insets and radius for the focused and unfocused button to the same values. Here is a tutorial on JavaFX CSS and the ever useful JavaFX CSS reference guide.

    how can I make it work like an menu button (when I press it to remain in focused state untill I press another “menu” button).

    I don’t quite understand this question – that is the default behavior of a button. Maybe you are mixing focus and arm states and actually want a ToggleButton?

    Is there a way to group nodes into the same focus?

    Not built into the platform on the moment. You could write your own FocusModel class for a layout pane which remembers the last control in the pane which had focus and reassigns it focus again whenever the pane gets focus back or something like that. It would be custom code though. Concepts you would need to use are the focus property of nodes, the node requestFocus api (sometimes with a delay by executing in Platform.runLater to ensure that you override default focus processing) and the fact that (I think) the default focus order depends on the order of children within a Parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a small administration page for game servers which you can add/remove/edit
Is there any way I can remove the small line that appears under tabs
I am writing a small class which can create/remove/rename/search for files and directories on
I have this small jquery script that does not work if I remove the
we can remove formula from one cell by cell.setCellFormula(null) . but if i want
One can remove all calls to printf() using #define printf . What if I
How we can remove an array entry from : var a = [],b =
How to I can remove posts from a specific category from homepages in wordpress?
Is there a way I can remove the background bar image in the SeekBar
I am looking for an API that can remove bundle items added in a

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.