B4J Tutorial UI App (JavaFX) Tutorial

Discussion in 'B4J Tutorials' started by Erel, Nov 18, 2013.

  1. pauleffect

    pauleffect Member Licensed User

    mindful and miquel like this.
  2. Toley

    Toley Active Member Licensed User

    Is there any information on how to create an executable for Linux ? Especially for the Raspberry Pi ? Thanks
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    The generated jar file can be executed by calling java -jar <your jar>.

    You can also start the program by clicking on the jar icon if java is installed correctly.
     
  4. Toley

    Toley Active Member Licensed User

    Hi Erel, this is exactly what I do (the command line) I have the message "Program started." but nothing else happens.
    It can be seen in the picture. The java task slowly decrease but I never see anything appear in the screen. Also when I do java -version I can see I have java 1.8.0 installed.
     

    Attached Files:

    Last edited: Feb 24, 2014
  5. Erel

    Erel Administrator Staff Member Licensed User

    Are you testing it with a monitor connected to the RasPi board?
     
  6. Toley

    Toley Active Member Licensed User

    No should I ?

    Edit : Thanks Erel it works at the HDMI output, but very very slowly. I think I will stick to non UI applications.
     
    Last edited: Feb 24, 2014
  7. ratinho7adrs

    ratinho7adrs New Member

  8. ratinho7adrs

    ratinho7adrs New Member

    I already know how to do it...

    Code:
    Sub Process_Globals
        
    Private fx As JFX
        
    Private MainForm As Form
        
    Private SubForm As Form
    End Sub
    ...And...
    Code:
    Sub AppStart (Form1 As Form, Args() As String)
        
    'MainForm
        MainForm = Form1
        MainForm.RootPane.LoadLayout(
    "Main")
        MainForm.Show
        
    'SubForm
        SubForm.Initialize("SubForm", -1, -1)
        SubForm.RootPane.LoadLayout(
    "Resultados")
        SubForm.Show
    End Sub
    But with this, the code of the two forms is the main code module and will be a mess.

    Choose to use a module for each form.
    See this topic http://www.basic4ppc.com/android/forum/threads/two-forms-where-does-the-code-go.35564.
     
  9. DarylSpitfire

    DarylSpitfire New Member

    I just downloaded & installed everything (6/16/2014). It all comes up and looks correct. Then I tried your several B4J Tutorials. I followed and did [Designer][Create New Layout], it takes me to the
    JavaFX Scene Builder 2.0, Build Information:Version: 2.0-b20, Changeset: 5cac093e5c1f
    Date: 2014-03-21 09:29. That seems to work ok. I could drag items (controls, etc.) into position and [Save] the file. Then in B4J I tried [Designer]{trial2}[Generate Members] but the resulting dialog is always empty, blank, no views or events listed; none! I've also tried numerous variations, filenames, locations of the fxml, and nothing works. So I cannot get past this point. The photo attached shows all 3 windows running. This is very frustrating not; not even to get to 1st base. What's going on?
     

    Attached Files:

  10. Erel

    Erel Administrator Staff Member Licensed User

  11. DarylSpitfire

    DarylSpitfire New Member

    Thanks, I had not scrolled down far enough in JFX to find the ID field. :confused:Sorry, my mistake.

    BTW: I've been programming a long time in many languages (I started with Fortran in '71), but Java is a new one to me. Frankly I had gone to both the Oracle & AOSP websites to look at their tools. [I am writing code for some automation in my off-grid home since I'm now retired and I'm mounting an Android tablet on the wall to display data from my LAN coming from numerous distributed processors (mostly Arduinos with ethernets and a couple of PC's) around the place. I downloaded the new Android Studio tools and spent a day starting [trying] to go through their tutorials. But theirs were written for the older Eclipse-based IDE and were only partially converted for the new AS SDK. Consequently their tutorial occasionally mismatched the tools. It would have been better if it grossly mismatched, then I would have not wasted my time. It was very frustrating trying to follow faithfully yet adapt on the fly to the differences. So, I'm sorry but that's the mindset that I was in when I discovered Anywhere Software and B4J. I downloaded B4A and it worked fine. But I used VB1 thru VB6 & .NET for many years and so B4A was easy. I was (still am) hung up on learning Java and so I'm looking for alternatives to the Eclipse/JDK & AS SDK tools. I'll give B4J another few days tryout (to test myself more-so than your tools) and if the learning curve is still too steep for me (retirement is supposed to be easy, :cool:right?) I'll probably go with B4A. If the Java works out I'll rewrite my present Python code (30K lines with Qt4) by years-end too. Maybe I can shoe-horn Linux onto my tablet by then too.

    Thanks for your prompt & helpful (I tried it, it works:D) reply!,
    Daryl
     
  12. coslad

    coslad Well-Known Member Licensed User

    HI

    I have installed JavaFX Scene Builder 2.0 but it doesn't look fine , it is attached a screenshot .

    Any idea ?

    Solved !!!!

    I tried to run Java Fx into a vmware virtual machine , to solve the issue you need to disabe 3d accelerate flag.
     

    Attached Files:

    Last edited: Sep 14, 2014
  13. fabero

    fabero Active Member Licensed User

    Someone know a way to change the layout dimension, based on the OS Version? In my tests, the windows layout is slightly different to mac osx.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  15. JoeInvestiga

    JoeInvestiga Member

    I had one problem...

    In my, javaFX Scene Builder... put in no one imageview there put in 9 (nine) imageview (named (id): Ifoto, in each one). Who am I will write in code (array... imageview...?)?

    Thanks for your response
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Don't use JavaFX scene builder. Use the internal designer.

    Scene builder is deprecated and should not be used in new projects.
     
  17. JoeInvestiga

    JoeInvestiga Member


    Thanks... I will try
     
  18. JoeInvestiga

    JoeInvestiga Member

    Hi expert:

    Play Sound or Music in B4J...

    I need to reproduce voices and music in B4J.

    Thanks for you help me.

    JoeInvestiga
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
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