B4J Question Autocomplete Textfield

Discussion in 'B4J Questions' started by tcpip, Mar 29, 2015.

  1. tcpip

    tcpip Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

    Attached Files:

    jmon likes this.
  3. tcpip

    tcpip Member Licensed User

    Thank you Erel for your reply.
    I have added the library but when i try to run this example i get this error:
    Program started.
    Error occurred on line: 23 (main).
    java.lang.ClassNotFoundException: org.controlsfx$control$textfield$TextFields
    at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:287)
    at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:73)
    at b4j.example.main._setautocomplete(main.java:95)
    at b4j.example.main._appstart(main.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:224)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at b4j.example.main.start(main.java:36)
    at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
    at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
    at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
    at java.lang.Thread.run(Thread.java:745)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Make sure that the library is still checked in the libraries list.
    And make sure to use Java 8 under Tools - Configure Paths.
     
  5. tcpip

    tcpip Member Licensed User

    I installed java8 and added the path....but i get now another error

    Cannot find: C:\Program Files (x86)\Anywhere Software\B4J\libraries\controlsfx-8.jar
     
  6. tcpip

    tcpip Member Licensed User

    Its ok Erel.
    I found and download the controlsfx library and now is working.

    And it seems good.

    thanks
     
  7. Fabrice La

    Fabrice La Active Member Licensed User

    I am using the SetAutoComplete. work nice.
    Now i would like to use the Event that select the word (Event click the word in the autoComplete list )?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    There is no such event. You can use the TextChanged event and check whether the current text matches one of the items.
     
  9. le_toubib

    le_toubib Active Member Licensed User

    hello all
    is there a way to increase font size of the drop down list ???
    Also , is there a way to keep the list from appearing in case i add text programatically ??
     
    Last edited: Jan 12, 2017
  10. Erel

    Erel Administrator Staff Member Licensed User

    You can change the font size:
    1. Create a css file:
    Code:
    .auto-complete-popup {
       -fx-
    font-size: 20;
    }
    2. Load it:
    Code:
    MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "test.css"))
    [​IMG]

    There is no simple way to prevent the list from opening.
     
    le_toubib likes this.
  11. le_toubib

    le_toubib Active Member Licensed User

    thanx erel for replying
    is there a way to make the list width larger ? and height ?
     
  12. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    did not test, but something like this:

    Code:
    .auto-complete-popup .list-view {
    -fx-pref-width:
    100;
    }
     
    le_toubib likes this.
  13. jmon

    jmon Well-Known Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice