I’m working on these graphics projects in Java, and I need to align things to the base of my graphics window…the problem is that I’m on a mac and I can resize the window and if I minimize and reopen the window, it is just the size I had made it earlier. How do I determine the “true” height of the graphics window I’m working with?
Share
If you want to know the size of the window, you can call
getSize()on theWindowobject (of which yourJFrameis a subclass). If you are interested on understanding the new size of your window when it gets resized, you can implementComponentListenerand receiveComponentEvents via theComponentResized()callback.