Hello,
I want to dynamically load jgauges on a panel.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
I get this error.
			
			I want to dynamically load jgauges on a panel.
			
				B4X:
			
		
		
		Sub GetListTempSensors()
    Dim myselect As String
    Dim sql As SQL = DBMdomotica.GetSQL
    myselect = "SELECT tblinputs.* FROM tblinputs INNER JOIN tblmodules ON (tblinputs.idmodule = tblmodules.idmodule) WHERE tblmodules.soort = 'a'"        
    
    Dim myresult As List = DBMdomotica.SQLSelect(sql,myselect)
    DBMdomotica.CloseSQL(sql)
   
    If myresult.size > 0 Then
       
        Dim r As Int
        For r = 0 To myresult.Size - 1
            Dim resultdata As Map = myresult.Get(r)
            Dim mytemp As temperatuur
            mytemp.beschrijving = resultdata.Get("beschrijving")
            mytemp.inputid = resultdata.Get("idinput")
            mytemp.modulecode = resultdata.Get("idmodule")
            mytemp.tempvalue = 0
           
            Dim mygauge As Gauge
            mygauge.Initialize("")
            mygauge.Tag = mytemp.modulecode
           
           
            InitGauge(mygauge,-5,50,mytemp.tempvalue,1,mytemp.beschrijving,"°C","DASHBOARD","")
            listTemp.Add(mygauge)
       
            PanelMain.AddNode(mygauge,(r+1)*100,100,200,200)
           
           
        Next
    End If
   
End Sub
Sub InitGauge(s_gauge As Gauge, minValue As Double, maxValue As Double, Value As Double, decimal As Double, Title As String, Unit As String, Skin As String, subTitle As String )
   
   
    Dim jo As JavaObject = s_gauge
    jo.RunMethod("setSkinType", Array(Skin))
    jo.RunMethod("setMinValue", Array(minValue))
    jo.RunMethod("setMaxValue", Array(maxValue))
    jo.RunMethod("setValue", Array(Value))
    jo.RunMethod("setTitle", Array(Title))
    jo.RunMethod("setUnit", Array(Unit))
    jo.RunMethod("setSubTitle", Array(subTitle))
    jo.RunMethod("setForegroundBaseColor", Array(fx.Colors.RGB(82,82,82))) ' Color for title, subtitle, unit, value, tick label, zeroColor
    jo.RunMethod("setUnitColor", Array(fx.Colors.RGB(82,82,82)))
    jo.RunMethod("setTitleColor", Array(fx.Colors.RGB(82,82,82)))
    jo.RunMethod("setSubTitleColor", Array(fx.Colors.RGB(82,82,82)))
    jo.RunMethod("setValueColor", Array(fx.Colors.RGB(82,82,82)))
    jo.RunMethod("setBarBackgroundColor", Array(fx.Colors.RGB(255,64,64)))
    jo.RunMethod("setBarColor", Array(fx.Colors.RGB(125,125,125)))
    jo.RunMethod("setDecimals", Array(1))
End SubI get this error.
Waiting for debugger to connect...
Program started.
apr 02, 2017 10:17:50 AM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
apr 02, 2017 10:17:51 AM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
apr 02, 2017 10:17:53 AM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge0z29ncowgvd1bmdovh|f5ae852, debugUnreturnedConnectionStackTraces -> false, description ->...
Error occurred on line: 56 (Main)
java.lang.RuntimeException: Object should first be initialized (Gauge).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:32)
at anywheresoftware.b4j.objects.NodeWrapper.innerInitialize(NodeWrapper.java:83)
at anywheresoftware.b4j.objects.NodeWrapper$ControlWrapper.innerInitialize(NodeWrapper.java:794)
at anywheresoftware.b4j.objects.NodeWrapper.Initialize(NodeWrapper.java:75)
at b4j.example.main._getlisttempsensors(main.java:207)
at b4j.example.main._appstart(main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:612)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:36)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
 
				 
 
		 
 
		 
 
		 
 
		 
 
		