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.
#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
'speed
Private vx = 10, vy = 10 As Double
'location
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
MainForm.SetFormStyle("UNIFIED")
MainForm.RootPane.LoadLayout("1")
MainForm.Show
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