Java & B4J Questions

I apologize for the length. I am a programming hobbyist. Well over a decade ago, I programmed several simple games on my Mac in Java using Code Warrior (which was overkill for my needs), creating applets that I placed on the web. Over the years, those applets no longer continued to work in modern browsers.and, in any case, I moved on, concentrating on desktop programs using RealBasic/Xojo and MySQL and occasionally PHP and Javascript for the web. Now I wonder if I’d be better served by moving away from Xojo since it has never met my needs for the web or mobile. While I will continue to concentrate on desktop programs, I would also like the ability to create simple mobile apps as well as web based apps. Is Java or B4J likely to better serve my needs. As a starting point, I give B4J a minus since it seems it can’t be run on a Mac without virtualization software (like Parallels) which I’ve never used or understood. I certainly don’t want to get into partitioning disks, etc. I just want to write my programs (I prefer linear to object-oriented) and use them in as many ways as possible with a minimum of fuss. Should I return to Java? Xojo was certainly better at helping create interfaces back then, is that still true. What does Java offer nowadays in place of web “applets”. If I go to Java, is Net Beans the best tool for a hobbyist? Needs: quick/easy UI development, simple programmable canvas-type graphics, connectivity to MySQL.

Complex. Netbeans is a Great ide for desktop and mobile. With the codenameOne plug-in you can also design and write mobile cross platform. Starting with free for until 8,5mb jar size you can develop iOS and android with build service by codenameOne. For 20 bucks per month you can have it for unlimited jar size iOS and android builds.

Coming to web. Vaadin is possible but expensive if you need visual designer. Jmix.Io is nice for complex applications.

Netbeans runs on macOS.


Could you not use most of the B4J code with B4i?

If you have experience with Java and JavaFX for GUI development, then the next logical step would be Kotlin with TornadoFX which is a superset of JavaFX. But Kotlin Multiplatform Mobile which is gaining a lot of momentum would be the way to go.

Dart/Flutter is another option for cross-platform development - although geared mostly for mobile development. It can do desktop too. Only need to learn one language ‘Dart’ vs Java/Kotlin vs Objective-C/Swift. There are tons of resources and tutorials out there.

Another up and coming option is Golang using the Fyne framework. Refer to this book: Building Cross-Platform Applications with Fyne.

There are lesser known options like Delphi which is a RAD IDE , you can Download the Free Delphi: Community Edition - Embarcadero). Again you would only have to learn one language, Object Pascal. Derek Banas, a very popular Youtuber programmer recently made a Delphi tutorial.

In the comments section of the Youtube video, Derek Banas replied:

Thank you :slight_smile: That is so funny because I do VB work on and off. People laugh at me, but when I show them how much demand there is for it they are surprised. I love being the only option in town when people are in the need to give someone money :slight_smile: I see Delphi as a great option when the client also wants similar capabilities on mobile.

And even lesser known than Delphi would be PureBasic and it’s sister app SpiderBasic. The language is purely procedural and fairly straightforward. But there are less resources to learn the ins and outs since it’s a very small team.

C# and VS is also an option that is maturing quickly
I’ve been using VS 2022 Preview on MacOS to write C# code FOR macOS and it also has options for Mobile & Web


There are lots of well funded trains on the tracks and they are all coming fast
VERY fast

1 Like

I have taken a “deep dive” into Purebasic for the last month or so… it does not have has many features as java, delphi or even Xojo but that’s not necessarily a bad thing. It is extremely lean and mean.

Executables are very small, a hello world app clocks in at 300K on OSX, and command line apps are even smaller. Compile/test cycles are extremely fast. You can compile from the IDE or command line and it even has a command line debugger.

It’s not object oriented so it has taken time for me to rewire my brain for procedural programming. It allows easy access to the OS APIs but its not complete. Some things just don’t work as I have found out.

The GUI builder is primitive and has its quirks but it does work. Syntax takes some getting used to.

It has a canvas class like Xojo so it is possible to build your own gadgets (controls in Purebasic speak). I didn’t like the included splitter gadget so I wrote my own.

1 Like

@npalardy Agreed :slight_smile:
C# 10, Blazor, Razor with .Net 6. is beginning to look like a viable option for Modern Cross-Platform Development

@pjsmith67 great insight! I’m still learning PureBasic, so I’m still somewhat of a newb. I recently purchased the PureVision form designer for PureBasic. Do you have any experience or thoughts about it, Phil? :grinning:



@cmalumphy There are also a host of application that would allow you to develop hybrid web apps if you’re not necessarily looking for native-like performance. SpiderBasic is one I mentioned previously. But there are also NSB Studio and VisualNeo Web which was actually written in Delphi.

1 Like

No, I have not. PureVision is Windows only, as far as I know, and I’m on a mac. So is the other major GUI builder that I am aware of, IceDesign.

There is an object design library for Purebasic that looks like it would make writing a GUI designer pretty easy. I’ve kicked around the idea of trying to write one… but I have other things I want to do first.

NS Basic is still kicking around ?
NS Basic started out on the Apple Newton (which I still have here somewhere along with a copy of NSBasic - I think its on the card)

1 Like

So many “fun things to do” so little time

1 Like

Swift is also making headway into the various platforms in recent times.
You can install write and compile Swift on Windows and Ubuntu flavours of Linux now.
With Visual Studio having plugins for the language and autocomplete, or using the lightweight Visual Studio Code editor for simpler projects.
Along with having increasing support for scripting on web servers as well.

Not bad for a fairly new language that was only introduced in 2014, in comparison to C# which was first released in 2000.

Has Swift got any UI toolkits outside macOS ?

On Windows I’m not sure if you can use the system frameworks directly with Swift.
But on Linux which I recently looked into, there are a number of open source Swift GUI projects, and I read somewhere that you could access GTK+ with Swift, but I’m just thinking about switching to a Linux machine at this stage.

But for a language that has only been fairly stable in it’s development for two or three years, that’s very early days for a programming language, and I was surprised to see it have as much cross platform traction so early in it’s lifecycle.

I think with Swift it’s a case of watch this space.
But the signs are good for more cross platform support over time, but of course it will never catch up on languages like Python or Java, who have been around forever, and have an enormous quantity of resources available because of that.

Swift has no UI on Linux and on Windows. Nor on Android. It is an Apple product if you look on it now. And that will not change within short time.

You can approximate some OOP concepts though, for example:

You can create Structures and you can take existing structures and Extend them. You can then pass in the extended structure to Procedures that were defined to accept the base structure.

You can also create your code in named Modules.

So we can use the above to make a reasonable imitation of this example of Java Classes and inheritance ( tweaked a bit to demonstrate extending the structure ).

DeclareModule animal
  Structure animal
  Declare.i New(name.s)
  Declare Eat(*p.animal)

Module animal
  Procedure.i New(name.s)
    *p.animal = AllocateStructure(animal)
    *p\name   = name
    ProcedureReturn *p
  Procedure Eat(*p.animal)
    Debug "I can eat"

DeclareModule dog
  Structure dog Extends animal::animal
  Declare.i New(name.s, breed.s)
  Declare Display(*

Module dog
  Procedure.i New(name.s, breed.s)
    *   = AllocateStructure(dog)
    *p\name  = name
    *p\breed = breed
    ProcedureReturn *p
  Procedure Display(*
    Debug "My name is " + *p\name + ", I am a " + *p\breed

* = dog::New("Rohu", "Labrador")

Just to clarify, the code between DeclareModule and EndDeclareModule is the public interface and the code between Module and EndModule is the implementation.

1 Like

There is another new development tool coming up very nicely.

Its name is TwinBasic.

Probably currently it does not have a Mac version but the core developers are planning to release for all that is Win, Linux, Mac.

Do check it out here.

Though it is being heavily developed it is ver promising and it will be a very powerful alternative to all BASIC language tools like Xojo, B4X, PureBasic, etc.

1 Like

Very early days I agree, but there are good signs given Swift’s short lifecycle.


@MarkFX don’t forget REMObjects’ implementation of Swift which they call 'Silver". Of the seven languages they offer (which all can be mixed and matched in one project), the Swift implementation is free. :nerd_face: