0

I am trying to change the width of the Font size combobox's listview of the HTMLEditor Component. Here is what i tried already:

editor.lookup( "font-size-menu-button" ).lookup( "list-view" )
          .setStyle( "-fx-pref-width: " + ((ComboBox) editor.lookup( "font-size-menu-button" )).getPrefWidth() + "; -fx-max-width: "
              + ((ComboBox) editor.lookup( "font-size-menu-button" )).getPrefWidth() + ";" );

I want it to be the same as the ComboBox width is. I have also tried trying it per css only but i can not get the size that way, i have to guess, that is too unsafe i think.

Marcel
  • 1,509
  • 1
  • 17
  • 39
  • Possible duplicate of [how to set width of drop down of combobox in java fx](http://stackoverflow.com/questions/22190370/how-to-set-width-of-drop-down-of-combobox-in-java-fx) – Jonatan Stenbacka May 26 '16 at 15:32
  • @Jonatan Stenbacka No, it is not a possible duplicate it is quite diffrent. The diffrence is that i want to size only a single list view which is a part of the HTMLEditor which is a default javafx component. It is totally diffrent. – Marcel May 26 '16 at 16:16
  • Okay. I think you need to clarify your question then. You are saying that your want to "change the width of the Font size combobox's ListView", which I interpret as that you have a `ComboBox` that you've named "Font size" whose `ListView` you want to change the width of. Is my interpretation incorrect? Your not saying anything about a HTMLEditor for instance. – Jonatan Stenbacka May 27 '16 at 07:43

0 Answers0