I have created a JavaFX button and would like to make it display the complete text. I am not able to find a workaround for this. I know we can achieve multi line text display.But then if the word comprises of more than a certain number of letters, the button doesn't let the whole word fit in and displays ellipsis instead.
Below is how my button looks. As you can see there's so much space around the button text, yet it doesn't display the whole word.
----EDIT 1 : START----
This question was marked as duplicate by referring to this question : How to prevent text from turning to ellipsis on small buttons in JavaFX?
However, this is not what I am looking for. I think I did a good job at explaining my scenarion in my OP. But I will try again to elaborate on it.
1). First of all, my button is not a small button as the referred post's title reads.
2). Secondly, my intention is not to alter the size of button. I want the button to remain as it is.
3). Thirdly, my issue is not with ellipsis. I know how to get rid of the ellipsis.
4). Finally, MY real issue : How to alter the button, so that it doesnot leave so much of space around its text. I had already provided the image of my button. I would like to make use of the button region that I marked with red arrow. As you can see, there is so much space left, but still the whole word does not show and has ellipsis.
SOLUTION : START
In the meantime I came across a very helpful link : Confgure margin for individual element via java fx css
This is what solves my issue and not the original post that was referred to.
I added -fx-padding: 1px;
css property for my buttons and everything works liek a charm now.
Below is how my buttons look right now :
SOLUTION :END
----EDIT 1 : END----