B4J Library JavaFX BorderImage - similar to android 9 Patch.

Staying with the graphic theme, this is a wrap of the javafx class BorderImage and associated classes. It is like an Android 9 Patch for Javafx.


1613670955543.png


At a minimum you specify the image, border width, border Insets, and slice width. The methods in BorderImage_Utils provide shortcuts to creating a border image. Or you can take full control and specify everything yourself if necessary.

Documentation for the border image is here https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/BorderImage.html

The example displays the screen in the image. All buttons have the same BorderImage. Button 3 gets resized when you resize the window.

All the code is in the example project and a B4xLib is attached.

Let me know how you get on with it.
 

Attachments

  • BorderImage-b4xlib.b4xlib
    6.5 KB · Views: 220
  • BorderImage.zip
    93.3 KB · Views: 213
Last edited:

stevel05

Expert
Licensed User
Longtime User
JavaCompilerPath
Since it has become available I've updated my new project template so it is in all of my projects. Perfect for easy testing on all versions. I should remember to remove it before posting.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Since it has become available I've updated my new project template so it is in all of my projects. Perfect for easy testing on all versions. I should remember to remove it before posting.
Another option is to make it conditional in your template:
B4X:
#If JAVA8
#JavaCompilerPath: ...
#Else IF JAVA11
...
#End IF
 

stevel05

Expert
Licensed User
Longtime User
Another option is to make it conditional in your template:
Yeah, I did. But I left the build configuration on the wrong option when I exported the project. Which caused a problem when the path did not exist on the PC.
 
Last edited:
Top