BPak Active Member Licensed User Longtime User Jan 19, 2014 #1 Is there a way to put image into a button? I wish to use buttons with the Triangle (arrow <) for database navigation.
Is there a way to put image into a button? I wish to use buttons with the Triangle (arrow <) for database navigation.
giga Well-Known Member Licensed User Longtime User Jan 19, 2014 #2 Check this link out: http://www.b4x.com/android/forum/threads/button-draw-draw-text-and-image-on-a-button.36781/ Is that what you are looking for? Upvote 0
Check this link out: http://www.b4x.com/android/forum/threads/button-draw-draw-text-and-image-on-a-button.36781/ Is that what you are looking for?
rwblinn Well-Known Member Licensed User Longtime User Jan 19, 2014 #3 Hi, another option is to use CSS via the JavaFX Scene Builder. Drag an ImageView on top of a Button and it will automatically be set as a graphic for the button. Then select the ImageView and type the URL of the image into the ImageView's image field in the Scene Builder properties pane. To select an image file from the DirAssets folder, select the file accordingly in the ImageView Properties > Image. After selection, the URL looks like (Example): @helpimage.png The FXML contains as a result (Example): Code: Copy <Button id="buttonHelp" font="$x4" layoutX="20.0" layoutY="20.0" mnemonicParsing="false" text="Help"> <graphic> <ImageView pickOnBounds="true" preserveRatio="true"> <image> <Image url="@helpimage.png" /> </image> </ImageView> </graphic> </Button> Upvote 0
Hi, another option is to use CSS via the JavaFX Scene Builder. Drag an ImageView on top of a Button and it will automatically be set as a graphic for the button. Then select the ImageView and type the URL of the image into the ImageView's image field in the Scene Builder properties pane. To select an image file from the DirAssets folder, select the file accordingly in the ImageView Properties > Image. After selection, the URL looks like (Example): @helpimage.png The FXML contains as a result (Example): Code: Copy <Button id="buttonHelp" font="$x4" layoutX="20.0" layoutY="20.0" mnemonicParsing="false" text="Help"> <graphic> <ImageView pickOnBounds="true" preserveRatio="true"> <image> <Image url="@helpimage.png" /> </image> </ImageView> </graphic> </Button>
supriono Member Licensed User Longtime User Sep 21, 2014 #4 hy rwblinn can do you upload project with image button.... Upvote 0
rwblinn Well-Known Member Licensed User Longtime User Sep 21, 2014 #5 Hi, see here. Also more to find in the B4J HOWTOs Category Buttons. Upvote 0