B4J Question Where to find webpage which lists good java-Libraries which can be used for B4J?

DonManfred

Expert
Licensed User
Longtime User
I´m going deeper into B4J and i want to extend it like i did (and do) with B4A.

Looking for Libraries to wrapp for B4A i mostly use
Android Arsenal and Google+ Community. Now i want to go deeper into B4J and want to wrapp Libraries to be used in B4J Apps.

Where to find webpage which lists good java-Libraries which can be used for B4J?

Can you point me to webpages like the ones for android; just for B4J?

I personally prefer to use the B4J internal Designer instead of Scene Builder

Should i search for java FX Libraries even if i use the internal Designer? Does B4J libraries have the same like this code which i use in most of my B4A library wrappings? I mean; can i use this for B4J libraries too?

B4X:
    //programmatically add view
    public void AddToParent(ViewGroup Parent, @Pixel int left, @Pixel int top, @Pixel int width, @Pixel int height) {
        //AttributeSet attrs;      
        //XmlPullParser parser = Resources.getXml(myResouce);
        //AttributeSet myAttributes = Xml.asAttributeSet(parser);
        //AttributeSet myAttributes = null;
        //anywheresoftware.b4a.       
        //mSignaturePad = new SignaturePad(ba.context, myAttributes);
        Parent.addView(this.getObject(), new BALayout.LayoutParams(left, top, width, height));
    }
  
    //this method cannot be hidden.
    public void DesignerCreateView(PanelWrapper base, LabelWrapper lw, anywheresoftware.b4a.objects.collections.Map props) {
        ViewGroup vg = (ViewGroup) base.getObject().getParent();
        AddToParent(vg, base.getLeft(), base.getTop(), base.getWidth(), base.getHeight());
        base.RemoveView();
        //set text properties
    }

    public void setLeft(int left)    {
        BALayout.LayoutParams lp = (BALayout.LayoutParams)this.getObject().getLayoutParams();
        lp.left = left;
        this.getObject().getParent().requestLayout();
    }
    public int getLeft()    {
        BALayout.LayoutParams lp = (BALayout.LayoutParams)this.getObject().getLayoutParams();
        return lp.left;
    }
    public void setTop(int top)    {
        BALayout.LayoutParams lp = (BALayout.LayoutParams)this.getObject().getLayoutParams();
        lp.top = top;
        this.getObject().getParent().requestLayout();
    }
    public int getTop()    {
        BALayout.LayoutParams lp = (BALayout.LayoutParams)this.getObject().getLayoutParams();
        return lp.top;
    }

Any hints are highly appreciated! :rolleyes:

If YOU (Yes, YOU! :)) have written a B4J Library for an UI Object and you want to share the Sourcecode with me (surely i want to use it just to "look at to learn"; i won´t republish it!) you are welcome to start a conversation with me to give me a downloadlink :)
 
Last edited:

Roycefer

Well-Known Member
Licensed User
Longtime User
If you want a UI element/library to wrap, check out this project: https://github.com/TomasMikula/RichTextFX . I've been meaning to get around to it, but haven't yet. Erel's gonna need this library for when he converts the B4X IDEs from .NET to Java.

And yes, any UI element you want to wrap should be a JavaFX-compatible UI element. B4J UI apps are JavaFX apps, regardless of what tool was used to design the UI. It is technically possible to incorporate Swing elements into a JavaFX app but I think that's considered kind of a hack, rather than an endorsed standard practice.

As for finding new libraries to wrap, checking out GitHub's trending or most popular Java projects is a good place to start.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
check out this project
This seems to be an complicated one to start wrapping for B4J :D
And yes, any UI element you want to wrap should be a JavaFX-compatible UI element
So my guess was right. I now need to learn how to do a wrapper for such fx-Objects. ;)

Thank you for your answer!
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
You'll see that it's not that hard. In my opinion, Android is unnecessarily complex with many APIs that are obscure, arcane, deeply mystical and subject to the whims of manufacturer implementations and version changes. By comparison, desktop Java and JavaFX is straightforward and logical and uniform (not to mention much more efficient).
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top