BASIC Developer & Support Resources => Translators => B4J => Topic started by: John on December 04, 2013, 12:57:08 pm

Title: B4J
Post by: John on December 04, 2013, 12:57:08 pm
Looks like Santa arrived early this year.  :)


B4J - The simple way to develop cross platform, desktop applications!

B4J is a 100% free development tool, similar to Basic4android that generates cross platform, desktop applications.
B4J follows the same concepts of Basic4android, providing a simple and powerful development tool.

B4J development tool is similar to Basic4android. The language and IDE are mostly identical.

The APIs (methods, keywords and libraries) are identical in some cases and different in other cases.

I converted existing frameworks such as DBUtils, HttpUtils2, DateUtils, RDC, ImageDownloader and others from B4A to B4J. It was simpler than I expected it to be. In some cases no changes were required at all.


There are two types of modules in B4J. Code modules and classes. Classes are identical to B4A classes.
Code modules are similar to B4A modules however they are more powerful as they can handle events.

A code module can be considered as a class with exactly one instance (such instances are sometimes called singletons or static classes). Activities and Services are not required in B4J. You should instead use code modules. Note that when you add an existing B4A activity or service to B4J project it will be converted to a code module.

CallSub is mostly not required in B4J as you can directly call methods of other classes or code modules.

Generally speaking it is simpler to develop with B4J as you do not need to deal with the activities (and services) life cycle. This also means that there is no such concept as "activity object".


The main difference is in the UI. B4J is based on JavaFX UI and Basic4android is based on the native Android UI.

It is worth going over Oracle Scene Builder tutorials to better understand the UI. Once you understand how the UI integrates with B4J code then the other concepts such as the "event name" concept are the same.

Colors - In Basic4android colors are represented as Ints (2 bytes for Alpha, R, G, and B). In B4J colors are represented as Paints.
You can use fx.Colors.From32bit to convert an Int value to a Paint.
Project site link (


I'm happy to release a new development tool, named B4J.

B4J is a development tool, similar to Basic4android that allows you to develop Windows, Mac and Linux apps.

You can download B4J here: (

B4J is free for both personal usage and commercial usage.

Best regards,
Erel Uziel
Anywhere Software

Update: I installed the 64 bit version of Java 7 JDK and JavaFX Scene Builder on Windows 7 64 bit. B4J is still a 32 bit IDE. The JavaFX designer/IDE is very nice. What we have here is Basic4Android language /IDE which is a Windows only environment that translates its BASIC code to Java. The B4J version uses JavaFX as the GUI toolkit and B4J is more or less just a BASIC to Java converter. Once the .JAR file is created you can run it on anything that runs JRE. (Java Runtime Environment)
Title: B4J
Post by: John on November 11, 2015, 02:14:17 am
B4J - The simplest way to develop cross platform, desktop, server and IoT solutions!

B4J is a 100% free development tool for desktop, server and IoT solutions.
B4J follows the same concepts of B4A and B4i, providing a simple and powerful development tool.
The compiled apps can run on Windows, Mac, Linux and ARM boards (such as Raspberry Pi).

Web Site / Download (



BTW: I subscribe to this companies other commercial BASIC products. Great stuff and the author is a generous and friendly guy.
Title: Re: B4J
Post by: John on November 11, 2015, 03:34:19 pm

I'm surprised you're not all over this. A VB like BASIC that runs on everything, common GUI, and FREE.

Title: Re: B4J
Post by: AIR on November 11, 2015, 04:30:02 pm
IDE only runs on Windows?  No thanks....
Title: Re: B4J
Post by: John on November 11, 2015, 05:30:22 pm
IDE only runs on Windows?  No thanks....

I knew you were going to say that.  :(

I'm going to give it a try and with the JavaFX graphic / forms library.

Getting Started Examples (see attached)
The following examples are included:

JavaFX Scene Builder
JavaFX Scene Builder (32-Bit) is a layout tool which lets users quickly design JavaFX application user interfaces, without coding. Users can drag and drop UI components to a work area, modify their properties, apply style sheets, and the FXML code for the layout that they are creating is automatically generated in the background. The result is an FXML file that can then be combined with a Java project by binding the UI to the application's logic.It features FXML Visual Editor which is an XML-based markup language that enables users to define an application's user interface, separately from the application logic,
Integrated Developer Workflow, preview what the user interface will really look like when deployed, unencumbered by the tool's menus and palettes, apply the look and feel of your choice to your GUI layout by using style sheets, and animations and effects can be applied seamlessly for more sophisticated UIs.

Title: B4J
Post by: John on November 13, 2015, 11:53:53 pm
I installed B4J (BASIC for Java) with JavaFX support.
Title: Re: B4J
Post by: John on January 04, 2021, 09:23:24 pm
I renewed my interest in B4J (BASIC for Java) FREE! I'm hoping to generate some interest with BASIC programmers also interested in cross platform Java apps.

Here is a graphic example I compiled as a standalone executable.

Code: [Select]
#Region  Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#End Region

Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Canvas1 As Canvas
Private Timer1 As Timer
Private vx = 10, vy = 10 As Double
Private currentX = 100, currentY = 150 As Double
Private smiley As Image
Private size As Double = 50
'smiley rotation
Private deg As Double = 0
End Sub

Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
smiley = fx.LoadImage(File.DirAssets, "smiley.gif")
Timer1.Initialize("Timer1", 20)
Timer1.Enabled = True
End Sub

Sub Timer1_Tick
   Canvas1.ClearRect(currentX, currentY, size, size)
   If currentX + size > Canvas1.Width Then
     vx = -Abs(vx)
   Else If currentX < 0 Then
     vx = Abs(vx)
   End If
   If currentY + size > Canvas1.Height Then
     vy = -Abs(vy)
   Else If currentY < 0 Then
     vy = Abs(vy)
   End If
   currentX = currentX + vx
   currentY = currentY + vy
   deg = deg + 1
   Canvas1.DrawImageRotated(smiley, currentX, currentY, size, size, deg)
End Sub