3
votes

I am working on a project that I cannot change to Java 1.8 to take in the newest JavaFX, this may or may not be relevant to the issue at hand. I have been trying everything that I can find on the internet to override the default look and feel for a drop down selection within the web browser. I have tried Javascript solutions, pure CSS solutions, and even trying to build the functionality using lists and CSS. Nothing seems to work within the WebView/WebEngine on JavaFX 2.2, most of the solutions I have tried work perfectly fine within Firefox (I know its not the best comparison because Firefox doesn't utilize webkit under the hood).

Any ideas on how to style the dropdown part of the select feature with JavaFX 2.2 WebView?

List of techniques I have tried:

2
Does styling work for other (simple) components? - Uluk Biy
Yes. Styling simple components works... I can style the outside of a normal <select> but not the dropdown portion. I found something that works however. Thank you for your comment. :D - Terin

2 Answers

0
votes

I found something that works and actually improves my interface. I was searching the UX Stack Exchange and found Chosen. Original UX Stack Exchange post

0
votes

I have create JavaFX app with webview (angularjs and bootstrap).
This is how the element is rendered in Chrome

enter image description here

This is how select element is rendered in ubuntu jar file

enter image description here

I have try multiple fixes but it seams that this dropdown is rendered from the browser itself (will be rendered different in linux, macos, windows) and there is no way to style it.

Mine working solution is to use plane js library as tom-select, no dependencies. And here how select element is rendered in chrome and in jar. Success :)

enter image description here