Here's a small example of how you could tackle this problem.
[CODE lang="b4x" highlight="15-18,19,28,37"]private Sub show_notedialog
Dim pnl As B4XView = xui.CreatePanel("")
pnl.SetLayoutAnimated(0, 0, 0, 340dip, 250dip)
pnl.LoadLayout("notedialog_layout")
Private year As Int = DateTime.GetYear(DateTime.Now)
Private month As Int = DateTime.GetMonth(DateTime.Now)
Private day As Int = DateTime.GetDayOfMonth(DateTime.Now)
Private today As String = day & "/" & month & "/" & year
lblnote_title.Text = "Add note for " & today
#if b4a
edt1_note.text = "A first B4A note"
#Else If b4j
TextArea1.Text = "A first B4J note"
#End If
Dim btntxt0 As String = "Yes"
Dim btntxt1 As String = "No"
Dim btntxt2 As String = ""
Dim rs As ResumableSub = notedialog.ShowCustom(pnl, btntxt0, btntxt1, btntxt2)
If btntxt0 <> "" Then
Dim btn0 As B4XView = notedialog.GetButton(xui.dialogResponse_Positive)
#if b4a
btn0.TextColor = Colors.Green
#else if b4j
btn0.TextColor = xui.Color_Green
#End If
Log(btn0.Text)
End If
If btntxt1 <> "" Then
Dim btn1 As B4XView = notedialog.GetButton(xui.dialogResponse_Negative)
#if b4a
btn1.TextColor = Colors.Red
#else if b4j
btn1.TextColor = xui.Color_Red
#End If
Log(btn1.Text)
End If
If btntxt2 <> "" Then
Dim btn2 As B4XView = notedialog.GetButton(xui.dialogResponse_Cancel)
#if b4a
btn2.TextColor = Colors.Yellow
#else if b4j
btn2.TextColor = xui.Color_Yellow
#End If
Log(btn2.Text)
End If
Wait For (rs) Complete (Result As Int)
If Result = xui.dialogResponse_Positive Then
Log("Positive response")
End If
If Result = xui.dialogResponse_Negative Then
Log("Negative response")
End If
If Result = xui.dialogResponse_Cancel Then
Log("Cancel response")
End If
End Sub
[/CODE]
The B4XDialog creates buttons when needed that is when the argument is not an empty string ("").
By using string variables for the arguments you can easily test if a button is available (<> "") (and you can set the text in any language)
When a button is present then you can set its properties according to the environment (B4A or B4J).
In the attachments you can find 2 versions to test.
Note: this example is a B4XPages project.
P.S. : put the line with the #CustomBuildAction in comment when testing
B4X:
'#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"