Bug? ComboBox

Discussion in 'B4J Bugs & Wishlist' started by GiulioVale, Jul 27, 2015.

  1. GiulioVale

    GiulioVale Active Member Licensed User

    Hi,
    with new internal design I make a simple form and put inside a ComboBox.

    If i load this form there is an error like
    Code:
    Program started.
    java.lang.RuntimeException: java.lang.StackOverflowError
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    114)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    82)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
        at b4j.example.main.start(main.java:
    36)
       ...

    Any help?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you upload the project?
     
  3. GiulioVale

    GiulioVale Active Member Licensed User

    Yes
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    Works fine here. Can you post the full error message from the logs?

    Check the libraries versions. Should be:
    [​IMG]
     
  5. GiulioVale

    GiulioVale Active Member Licensed User

    Libraries versions are correct

    full error message is attached

    thanks
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed User

    It looks like a bug in JavaFX. Which version of Java are you using?
     
  7. GiulioVale

    GiulioVale Active Member Licensed User

    java version "1.8.0_51"
    Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

    Windows 8.1
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    I'm testing it with the same version and it works properly.

    Does it happen in both debug and release modes? Try to change the combobox background with the designer and see whether it still happens.
     
  9. GiulioVale

    GiulioVale Active Member Licensed User

    Same error in debug and release
    Same error with background changed
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Please try the following code:
    Code:
    Sub Process_Globals
       
    Private fx As JFX
       
    Private MainForm As Form
    End Sub

    Sub AppStart (Form1 As Form, Args() As String)
       MainForm = Form1
       MainForm.SetFormStyle(
    "UNIFIED")
       MainForm.Show
       
    Dim cb As ComboBox
       cb.Initialize(
    "")
       MainForm.RootPane.AddNode(cb, 
    1010200100)
       cb.Style = 
    $"-fx-font-size:17.00;-fx-border-color:#000000;
       -fx-border-radius:0.00;-fx-border-width:0.00;-fx-background-radius:0.00;
       "$

    End Sub
    Do you see the same error?
    If yes then try to remove parts of the CSS string until the error disappears.
     
  11. GiulioVale

    GiulioVale Active Member Licensed User

    Hi Erel,
    if I remove -fx-background-radius:0.00;
    there is the attached error, otherwhise I see the combobox
     

    Attached Files:

  12. Erel

    Erel Administrator Staff Member Licensed User

    That's useful. Another thing that I would like you to try:
    Code:
    Sub AppStart (Form1 As Form, Args() As String)
       MainForm = Form1
       MainForm.SetFormStyle(
    "UNIFIED")
       MainForm.Show
       
    Dim cb As ComboBox
       cb.Initialize(
    "")
       MainForm.RootPane.AddNode(cb, 
    1010200100)
       cb.Style = 
    $"-fx-font-size:17.00;-fx-border-color:#000000;
       -fx-border-radius:0.00;-fx-border-width:0.00;-fx-background-radius:20.00;
       "$

       cb.Items.AddAll(
    Array ("Item 1""Item 2"))
    End Sub
    If it works then try to comment the last line and test again.
     
  13. GiulioVale

    GiulioVale Active Member Licensed User

    Sorry Erel
    now error with e without last row
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Thank you. For now the -fx-background-radius will only be added if the radius is different than 0.
     
  15. GiulioVale

    GiulioVale Active Member Licensed User

    Erel for now in my project with:
    Code:
    combo1.Style = $"-fx-background-radius:0.00;"$
    solve the problem
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Are you sure that the IDE is configured to use Java 8? Check it under Tools - Configure Paths.
     
  17. GiulioVale

    GiulioVale Active Member Licensed User

    You are in right my jre is 1.8 my jdk is 1.7. Now there is no problem with jdk 1.8.
    Thanks
     
Loading...