B4J Question How to set the canvas background color?

positrom2

Active Member
Licensed User
Longtime User
The canvas background color is not changed by any of those lines commented (when uncommenting).
Code: Copy
Sub AppStart (Form1 As Form, Args() As String)
  MainForm = Form1
  cvs.Initialize("cvs")
      MainForm.RootPane.AddNode(cvs, 0, 0,200,200)  'MainForm.Width/2, MainForm.Height/2)
      'MainForm.BackColor=fx.colors.Green
      'drawrect(0,0,cvs.Width,cvs.Height/2,fx.colors.yellow,True,0)
      'cvs.style="-fx-background-color: yellow"
How to set the background color?
 
Code: Copy
canvas1.DrawRect(0,0,canvas1.Width,canvas1.Height,fx.Colors.Red,True,1)
 
Upvote 0
Back
Top