B4J Question How to add a form background image

maxer73

Member
Hi all,

I'm Italian and this is my first post on B4J forum....

How to add in B4J a form image background like image i've attached so can add the controls above it?
I no need to resize a form, so i added at my code

MainForm.Resizable=False

Need to use FXBuilder?
I can add image directly from code using File.DirAssets?

If yes... how to do?

Thanks

MidiServer.jpg
 

maxer73

Member
Hi Erel,

thank you for your reply,

I tried your suggestion and it works with PNG ...

On my old PC I have a big problem of slowing down when I get to the edges of the desktop with windows that have pictures of background, but if i do not use pictures (only color background), everything works fine ...

This probably depends on my PC and my old video card (Nvidia Geforce2) because I have the same problem also with other programming languages, frankly, could also be a bug in Win XP.

I've attached .Jar file and image with my app written in other language and same (incomplete) using Scene Builder...

I saw that on JavaFX Scene Builder control imageView you can directly upload the image and make changes resizing, so in theory this line of code you may not even use it .... I've tried delete this line You suggested and work same mode... i can see image background

My window is not resizable, but, maybe need should use this statement if the window is resizable and you want the image that it is ... but I've seen that this can be done using Scene Builder Anchor Bread Contraints, then what about ......

You Win... B4J is very cool, and along with a powerful language and easy to use, have used a great VisualDesign (Scene Builder) for Java which is fantastic and offers lots of possibilities with the integration of CSS.
The combination of these two things is really good, then other very important thing is compatibility with all OS, another is the fact that if a person learns B4J, he also learned how to use B4A ... So just Fantastic ...

I've used VB for years and finally found B4J which is much better....

Thank you very much, please leave forever free !!!

I have a few questions:

- Only PNG format is supported for images in imageWiews or MainForm background using -fx-background-image?

- Not possible to use JPG, BMP or GIF for background and .ICO for MainForm icon?

- There is in Scene Builder control like GroupBox in VB so like white lines in my screenshot? I don't found it...Or just use Pane borders with round corners? But this has no text like blue text in my screenshot....

- How to add a horizontal or vertical scrollbars to textArea control?

- Could you tell me whether to make custom libraries for B4J ? Have to use Java language? or can do it using B4J Modules and Classes ???
I want to convert some libraries that I have written for other languages to use in B4J

Sorry for my bad english...

Max :D

ScreenShot.jpg
 

Attachments

  • jMidiServer.jar
    284.9 KB · Views: 247
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
- You should be able to use other formats as well.
- ICO is not supported. The other formats should work.
- There are many types of "Panes" in JavaFX. Any pane can work like a Groupbox.

- Scrollbars appear automatically:
SS-2014-03-06_13.40.15.png


- Set WrapText to False if you want to show a horizontal scrollbar.

- You can write libraries both in B4J and Java.

This Basic4android tutorial is relevant to B4J as well: Library compilation - Compile your project to a library

You can use jSLC to help with building Java libraries.
 
Upvote 0
Top