×

Genuine Coder's video: Custom Shapes for JavaFX Buttons Labels TextField ListView etc

@Custom Shapes for JavaFX Buttons, Labels, TextField, ListView etc
JavaFX provides option to define custom shapes using SVG paths. So, any shape as per your preference can be applied to almost all the controls (or the controls that extends Region class) in JavaFX User Interface library. Read more from: http://www.genuinecoder.com/custom-shapes-for-javafx-ui-components/ In this example, I have used JFXTextField text field from JFoenix library for getting material design based buttons. I have used Scene builder for preparing this tutorial. Basics of SVG Path: https://www.w3schools.com/graphics/svg_path.asp Create your own shapes from https://codepen.io/anthonydugois/pen/mewdyZ JavaFX Region: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/Region.html SVG Path Syntax: https://www.w3.org/TR/SVG/paths.html SVG Path for Heart Symbol:- ---------1------------ -fx-shape: "M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2 c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"; ---------2------------- -fx-shape: "M340.8,98.4c50.7,0,91.9,41.3,91.9,92.3c0,26.2-10.9,49.8-28.3,66.6L256,407.1L105,254.6c-15.8-16.6-25.6-39.1-25.6-63.9 c0-51,41.1-92.3,91.9-92.3c38.2,0,70.9,23.4,84.8,56.8C269.8,121.9,302.6,98.4,340.8,98.4 M340.8,83C307,83,276,98.8,256,124.8 c-20-26-51-41.8-84.8-41.8C112.1,83,64,131.3,64,190.7c0,27.9,10.6,54.4,29.9,74.6L245.1,418l10.9,11l10.9-11l148.3-149.8 c21-20.3,32.8-47.9,32.8-77.5C448,131.3,399.9,83,340.8,83L340.8,83z"; Code is available in GitHub: https://github.com/afsalashyana/JavaFX-Tutorial-Codes/tree/master/JavaFX%20Custom%20Shape%20Buttons Read more about custom shaped components at https://genuinecoder.com/javafx-buttons-with-custom-shape/

281

13
Genuine Coder
Subscribers
21.9K
Total Post
194
Total Views
680.9K
Avg. Views
11.7K
View Profile
This video was published on 2018-09-08 11:55:05 GMT by @Genuine-Coder on Youtube. Genuine Coder has total 21.9K subscribers on Youtube and has a total of 194 video.This video has received 281 Likes which are higher than the average likes that Genuine Coder gets . @Genuine-Coder receives an average views of 11.7K per video on Youtube.This video has received 13 comments which are lower than the average comments that Genuine Coder gets . Overall the views for this video was lower than the average for the profile.

Other post by @Genuine Coder