App port from B4A to B4J

Sergio83

Active Member
Licensed User
Longtime User
Hello everybody,

As I'm qualified, " I'm a long time user" of B4A and at this time I have to port some B4A apps to B4J, often not very easy for a B4J beginner ...
For now I got success for almost everything (many thanks to forum members and mainly to Erel!) but I'm facing some issues (may be they are not ..).

1- add an image to a pane, my code:

B4X:
Private img As Image

pnl_liste_node.addnode(img,4,45*(rang)+2,-1,-1)

I get a Java code compilation error:

src\b4j\example\b4xpage_docum.java:126: error: incompatible types: Image cannot be converted to Node

I tried different ways but without any success ...

2- Use of B4XDialog

B4X:
Private dialog_clue As B4XDialog

dialog_clue.Initialize(pnl_listes)
    dialog_clue.BlurBackground=True
    dialog_clue.BorderCornersRadius=5
    dialog_clue.VisibleAnimationDuration=400
    dialog_clue.BackgroundColor=fx.Colors.lightGray
    .....

I get a runtime error:

java.lang.NumberFormatException: For input string: "0xccccccff"

It would be great of some ofyou to lead me to a solution ...

Thanks by advance for your help!

PS: it is probably not the only issues I could be facing during my portage !
 

walt61

Active Member
Licensed User
Longtime User
Hi @Sergio83 ,

1. Do this:
B4X:
Private img As Image
Private iv as ImageView
iv.Initialize("ivevent")
iv.SetImage(img)
pnl_liste_node.addnode(iv,4,45*(rang)+2,-1,-1) ' The ImageView is the node to be added

2. Use the XUI colours (Int colours are expected for B4Xdialogs; the fx... colours have type Paint):
B4X:
dialog_clue.BackgroundColor=xui.Color_LightGray

Hope this helps!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…