B4J Question Using FontAwesome icons on ABMFloating buttons

Rob White

Member
Licensed User
Hi all,
I know the answer to this simple question must be somewhere but I have failed to find it.
Can someone show me in dummies detail how to put a FontAwesome icon on to a floating button.

This button is on a ABMTable, if that is important. Here is my test page ConnectPage code:-


B4X:
public Sub ConnectPage()           
    '    connecting the navigation bar
    ' ABMShared.ConnectNavigationBar(page)
    
    Dim Tbl As ABMTable
    Tbl.Initialize(page,"Tbl",False,False,True,"mytheme")
    Tbl.SetHeaders(Array As String ("ID","Chemical","Add","Select","Rate","Units"))
    Tbl.SetColumnWidths(Array As Int(0,100,1,1,5,5))
    Tbl.SetColumnVisible(Array As Boolean (False,True,True,True,True,True))

    Dim Chem1 As ABMInput
    Chem1.Initialize(page,"Chem1",ABM.INPUT_TEXT,"",False,"mytheme")
    Dim PlusBut1 As ABMButton
    
    PlusBut1.InitializeFloating(page,"PlusBut1",Chr(0xF055),"")
    Dim SelBut1 As ABMButton
    SelBut1.InitializeFloating(page,"SelBut1","","")
    Dim Rate1 As ABMInput
    Rate1.NumberStep=.1
    Rate1.Initialize(page,"Rate1",ABM.INPUT_NUMBER,"",False,"mytheme")
    
    Dim Units1 As ABMCombo
    Units1.Initialize(page,"Units1","",300,"mytheme")
    
    Dim R As List
    R.Initialize
    Dim T As List
    T.Initialize
    
    R.Add("id1")
    R.Add(Chem1)
    R.add(PlusBut1)
    R.Add(SelBut1)
    R.Add(Rate1)
    R.Add(Units1)
    Tbl.AddRow("R1",R)
    page.Cell(1,1).AddComponent(Tbl)

    ' refresh the page
    page.Refresh
    
    ' Tell the browser we finished loading
    page.FinishedLoading
    ' restoring the navigation bar position
    page.RestoreNavigationBarPosition   
End Sub

At the moment I get "java.lang.NullPointerException"
 

Rob White

Member
Licensed User
I will answer my own question!
Just found the icon tab in the ABM Demo.

Using page.UseFontAwesome = true gives an unknown member when put at bottom of BuildPage.
 
Upvote 0
Top