No, with SelectedIndex it arrives at the desired index but does not scroll.Do you mean B4XComboBox's SelectedIndex?
In B4A it just is SelectedIndexYes. Exactly this.
Can you share the code pls
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim Items As List
Items.Initialize
For i = 1 To 100
Items.Add($"Item #${i}"$)
Next
B4XComboBox1.SetItems(Items)
B4XComboBox1.SelectedIndex=49
End Sub
Here is B4J solution, project is attached.Unfortunately it doesn't have the same result on B4J.
Yes right i should have opened the thread on B4J, but I thought it was the same for the 3 environments B4J, B4A, B4i
Hi Ilan.i dont do anything it is automatically
i am assuming you are not using jdk 14+
View attachment 154097
Here is B4J solution, project is attached.
View attachment 154111
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
java.lang.StackOverflowError
at javafx.controls/javafx.scene.control.skin.VirtualFlow.getVisibleCell(VirtualFlow.java:1418)
at javafx.controls/javafx.scene.control.skin.VirtualFlow.getOrCreateCellSize(VirtualFlow.java:3024)
at javafx.controls/javafx.scene.control.skin.VirtualFlow.getOrCreateCellSize(VirtualFlow.java:2998)
at javafx.controls/javafx.scene.control.skin.VirtualFlow.getCellSizesInExpectedViewport(VirtualFlow.java:2321)
at javafx.controls/javafx.scene.control.skin.VirtualFlow.scrollToTop(VirtualFlow.java:1573)
at javafx.controls/javafx.scene.control.skin.VirtualContainerBase.lambda$new$0(VirtualContainerBase.java:82)
at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.controls/javafx.scene.control.ControlUtils.lambda$scrollToIndex$0(ControlUtils.java:47)
at javafx.controls/com.sun.javafx.scene.control.skin.Utils.executeOnceWhenPropertyIsNonNull(Utils.java:835)
at javafx.controls/javafx.scene.control.ControlUtils.scrollToIndex(ControlUtils.java:46)
at javafx.controls/javafx.scene.control.ListView.scrollTo(ListView.java:933)
at b4j.example.main$1.call(main.java:144)
at b4j.example.main$1.call(main.java:141)
...
'V2.00 - Depends on OpenJDK 19. Previous versions will not work.jGoogleMaps library
This library is similar to B4A and B4i GoogleMaps libraries. It is based on this open source project: https://github.com/dlsc-software-consulting-gmbh/GMapsFX/ (Apache 2 license). Under the hood it uses JavaFX WebView with GoogleMaps JavaScript API V3. Using the map is quite simple. You need...www.b4x.com
OpenJFX 19 Release Notes - Gluon
Released versions Version Release date Release notes 19.0.2.1 January 20, 2023 release notes 19.0.2 January 18, 2023 release notes 19 September 13, 2022 release notes Release Notes for JavaFX 19.0.2.1 List of Security Fixes Issue key Summary Subcomponent JDK-8296654 [macos] Crash when launching...gluonhq.com
Try this code, it should work on java19I have to use Java 19 because I use the map and the library only works on Java 19 and not 14
param.scrollTo(index);
Sub Activity_Resume ': modGeneral.clsConnec.SetObject(Me)
'---blablabla
'if blablabl
JumpToUltimo
end if
'---blablabla
End Sub
private Sub JumpToUltimo
Try
Starter.csu.CallSubPlus2(Me, "clv1_Jump", 250,Array("25"))
Catch
Log(LastException)
End Try
End Sub
'Class module
Sub Class_Globals
Private RunDelayed As Map
Type RunDelayedData (Module As Object, SubName As String, Arg() As Object, Delayed As Boolean)
End Sub
Public Sub Initialize
End Sub
'Similar to CallSubDelayed. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
Public Sub CallSubDelayedPlus(Module As Object, SubName As String, Delay As Int)
CallSubDelayedPlus2(Module, SubName, Delay, Null)
End Sub
'Similar to CallSubDelayed. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
'The target sub should have one parameter with a type of Object().
Public Sub CallSubDelayedPlus2(Module As Object, SubName As String, Delay As Int, Arg() As Object)
PlusImpl(Module, SubName, Delay, Arg, True)
End Sub
'Similar to CallSub. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
Public Sub CallSubPlus(Module As Object, SubName As String, Delay As Int)
Try
CallSubPlus2(Module, SubName, Delay, Null)
Catch
Log(LastException)
End Try
End Sub
'Similar to CallSub. This method allows you to set the delay (in milliseconds).
'Note that the sub name must include an underscore if compiled with obfuscation enabled.
'The target sub should have one parameter with a type of Object().
Public Sub CallSubPlus2(Module As Object, SubName As String, Delay As Int, Arg() As Object)
PlusImpl(Module, SubName, Delay, Arg, False)
End Sub
Private Sub PlusImpl(Module As Object, SubName As String, Delay As Int, Arg() As Object, delayed As Boolean)
If RunDelayed.IsInitialized = False Then RunDelayed.Initialize
Dim tmr As Timer
tmr.Initialize("tmr", Delay)
Dim rdd As RunDelayedData
rdd.Module = Module
rdd.SubName = SubName
rdd.Arg = Arg
rdd.delayed = delayed
RunDelayed.Put(tmr, rdd)
tmr.Enabled = True
End Sub
Private Sub tmr_Tick
Dim t As Timer = Sender
t.Enabled = False
Dim rdd As RunDelayedData = RunDelayed.Get(t)
RunDelayed.Remove(t)
If rdd.Delayed Then
If rdd.Arg = Null Then
CallSubDelayed(rdd.Module, rdd.SubName)
Else
CallSubDelayed2(rdd.Module, rdd.SubName, rdd.Arg)
End If
Else
If rdd.Arg = Null Then
CallSub(rdd.Module, rdd.SubName)
Else
CallSub2(rdd.Module, rdd.SubName, rdd.Arg)
End If
End If
End Sub
Public csu As clsCallSubUtils
You are askingIs there also a B4i solution for this
The biggest part in this thread was about B4J in B4A subforum. So I thought one more solution for B4i also would make the matter complete. My mistake...You should always create a new thread for any Issue you have. In this case also in the correct subforum.
Also mine.The biggest part in this thread was about B4J in B4A subforum. So I thought one more solution for B4i also would make the matter complete. My mistake...