


The following code sets the location of the Frame at (10, 10) relative to the origin of the physical screen of the corresponding GraphicsConfiguration. Call the getBounds method of a GraphicsConfiguration to find its origin in the virtual coordinate system. Similarly, calling getLocationOnScreen on a Frame returns virtual device coordinates.

In such an environment, when calling setLocation, you must pass a virtual coordinate to this method. Of the primary screen in the virtual device, negative coordinatesĪre possible, as shown in the following figure. Origin of the virtual-coordinate system is at the upper left-handĬorner of the primary physical screen. In a virtual device multi-screen environment in which the desktopĪrea could span multiple physical screen devices, the bounds of allĬonfigurations are relative to the virtual-coordinate system. The GraphicsConfiguration object is one of the GraphicsConfiguration objects of the target screen device. In a multi-screen environment, you can create a Frame on a different screen device by constructing the Frame with Frame(GraphicsConfiguration) or #Frame(String title, GraphicsConfiguration). This can only be done while the frame is not displayable. Frame and Titlebar) turned off with setUndecorated. The default layout for a frame is BorderLayout.Ī frame may have its native decorations (i.e. Since the border area is included in the overall size of the frame, the border effectively obscures a portion of the frame, constraining the area available for rendering and/or displaying subcomponents to the rectangle which has an upper-left corner location of (insets.left, insets.top), and has a size of width - (insets.left + insets.right) by height - (insets.top + insets.bottom). The dimensions of the border area may be obtained using the getInsets method, however, since these dimensions are platform-dependent, a valid insets value cannot be obtained until the frame is made displayable by either calling pack or show. The size of the frame includes any area designated for the border. Import Ī Frame is a top-level window with a title and a border. * or visit if you need additional information or have any * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Java desktop frame software#
* 2 along with this work if not, write to the Free Software Foundation,
Java desktop frame license#
* You should have received a copy of the GNU General Public License version

* version 2 for more details (a copy is included in the LICENSE file that * ANY WARRANTY without even the implied warranty of MERCHANTABILITY or * This code is distributed in the hope that it will be useful, but WITHOUT * by Oracle in the LICENSE file that accompanied this code. * particular file as subject to the "Classpath" exception as provided * published by the Free Software Foundation. * under the terms of the GNU General Public License version 2 only, as * This code is free software you can redistribute it and/or modify it * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * Copyright (c) 1995, 2020, Oracle and/or its affiliates. getAccessibleStateSet(): AccessibleStateSet.getAccessibleContext(): AccessibleContext.init(String, GraphicsConfiguration): void.Frame(String, GraphicsConfiguration): void.
