Dim p As Pane
p.Initialize("p")
Dim img As Image
Dim iv As ImageView
Dim l As Label
l.Initialize("l")
img.Initialize("directoryToImage","TheImage.jpg")
l.Text = "My Text field"
' image view initialise
iv.Initialize("iv")
' set the image
iv.SetImage(img)
' limit the size of the image
p.AddNode(iv,0,0,20,20)
' add the text
p.AddNode(l,30,0,100,20)
' add to combobox
ComboBox1.Items.Add(p)
Sub ComboBox1_ValueChanged (Value As Object)
Dim p As Pane = Value
'assuming label is 2nd node in pane
Dim l As Label = p.GetNode(1)
Log(l.Text)
End Sub
Ok GrazieYou need to get the selected item as a pane, then get the label.text from the label inside the pane.
B4X:Sub ComboBox1_ValueChanged (Value As Object) Dim p As Pane = Value 'assuming label is 2nd node in pane Dim l As Label = p.GetNode(1) Log(l.Text) End Sub
As regards the other problem, I've seen that before, but cannot remember the cause or solution. Sorry.
La provo subito, grazie mille?
This example gave me the idea to make a cross-platform combobox (B4X)
View attachment 155767CustomComboBox (Class) (Update: 2014/7/12)
Hi, There is a problem with the combobox in Javafx, is that it's difficult to customize it with B4J. Basically, if you want to set anything apart from a string, you will encounter problems as I have in this thread...www.b4x.com
[B4X] Free Geolocation Nominatim (Geocoding API)
Here's a demo of how to use the nominatim geocoding API for free. Note: There are other geocoding options if you want to know, leave your comments. Demo file attached Sub GeoCoderNominatim(Query As String) As ResumableSub Dim ResultURL As String Dim j As HttpJob Dim Parameter() As...www.b4x.com
Salve Ragazzi,?
This example gave me the idea to make a cross-platform combobox (B4X)
View attachment 155767CustomComboBox (Class) (Update: 2014/7/12)
Hi, There is a problem with the combobox in Javafx, is that it's difficult to customize it with B4J. Basically, if you want to set anything apart from a string, you will encounter problems as I have in this thread...www.b4x.com