B4J Question B4J Start with Fullscreen

coyote

Member
Licensed User
Longtime User
Hi,

how can I start an application in fullscreen mode?
I've searched for, but nothing found. Is it so trivial?

Coyote
 

margret

Well-Known Member
Licensed User
Longtime User
Don't know if this is the right way or only way but this works:

B4X:
Sub MaxScreen
     Dim jo As JavaObject
     jo.InitializeStatic("java.awt.Toolkit")
     Dim toolkit As JavaObject = jo.RunMethod("getDefaultToolkit", Null)
     Dim RS = toolkit.RunMethod("getScreenSize", Null) As String
     Dim Width, Height As Int
     Width = RS.SubString2( RS.IndexOf("width=")+6, RS.IndexOf(","))
     Height = RS.SubString2( RS.IndexOf("height=")+7, RS.IndexOf("]"))
     MainForm.WindowWidth = Width
     MainForm.WindowHeight = Height
     MainForm.WindowTop = 0
     MainForm.WindowLeft = 0
End Sub
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Is it so trivial?

Not trivial no, but as B4j is still new, we are all going to try to do thing's that no one else has done before, or at least has not been asked for yet and therefore no posts in the forum.

Searching for "B4j Window" found this link.
 
Upvote 0

coyote

Member
Licensed User
Longtime User
Magret, thanks for your Code but I prefer Erel Code from the link above, because of the taskbar which is considered. Although I'm not quite happy with it.
But your code gave me some new ideas.

Thx, Coyote
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Why is Erel 's Code deleted?,I've not seen it yet.
 
Upvote 0
Top