B4J Question Get screen size

Hi,
I'm trying to get the screen size in b4j and I've tryed to use inline java importing java.awt.toolkit.
But wasn't successful.
Is there a way to do that?
I want the window to use some percentage of screen size.
Thanks in advance
 

Magma

Expert
Licensed User
Longtime User
Hi,
I'm trying to get the screen size in b4j and I've tryed to use inline java importing java.awt.toolkit.
But wasn't successful.
Is there a way to do that?
I want the window to use some percentage of screen size.
Thanks in advance
Have also in mind... the DPIs (scale factor)...

you can use this... for example this maximize window...

B4X:
    Dim ps As Screen = fx.PrimaryScreen
    MainForm.WindowLeft = ps.MinX
    MainForm.WindowWidth = ps.MaxX - ps.MinX
    MainForm.WindowTop = ps.MinY
    MainForm.WindowHeight = ps.MaxY - ps.MinY
ps: I don;t remember if counts the taskbar height .... hmmm

For Dpi check that (thanks to Erel):
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…