geofasc.swing.tool
public class Frame extends JFrame
Frame (synonym is a window) is intended to be used as a
top-level container with a Canvas as its content pane.Component.BaselineResizeBehaviorEXIT_ON_CLOSECROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Frame()
Creates a new
Frame with width 640 and height 480 in pixels. |
Frame(int width,
int height)
Creates a new
Frame with the given size and with the
top-left corner of the display as location. |
Frame(int x,
int y,
int width,
int height,
String title)
Creates a new
Frame with the given size and at the given
location. |
Frame(int width,
int height,
String title)
Creates a new
Frame with the given size and with the
top-left corner of the display as location. |
Frame(String title)
Creates a new
Frame with width 640 and height 480 in pixels
and with the top-left corner of the display as location. |
| Modifier and Type | Method and Description |
|---|---|
void |
addToCanvas(Component... comps)
Convenience method for
Canvas.add(Component[]). |
void |
addToCanvas(Component comp)
Convenience method for
Canvas.add(Component). |
void |
close()
Sets this frame invisible and disposes it.
|
Canvas |
getCanvas()
Gets the canvas of this frame used as the actual content pane.
|
int |
getHeight() |
String |
getTitle() |
int |
getWidth() |
void |
setCanvas(Canvas canvas)
Sets the canvas of this frame used as the actual content pane.
|
void |
setCenterLocation()
Sets the position of this frame to the center location of its display.
|
void |
setContentPane(Container contentPane)
Overridden to permit only panes of type
Canvas as content panes. |
void |
setHeight(int height)
Sets the height of this frame.
|
void |
setLocation(int x,
int y) |
void |
setLocation(Point p) |
void |
setSize(Dimension d) |
void |
setSize(int width,
int height) |
void |
setTitle(String title) |
void |
setVisible(boolean b) |
void |
setWidth(int width)
Sets the width of this frame.
|
void |
toBack() |
void |
toFront() |
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, updateaddNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecoratedaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, showadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFont, postEventpublic Frame()
throws HeadlessException
Frame with width 640 and height 480 in pixels.HeadlessExceptionpublic Frame(int width,
int height)
throws HeadlessException
Frame with the given size and with the
top-left corner of the display as location.width - the initial width of this frameheight - the initial height of this frameHeadlessExceptionpublic Frame(int x,
int y,
int width,
int height,
String title)
throws HeadlessException
Frame with the given size and at the given
location.x - the initial x-coordinate of this framey - the initial x-coordinate of this framewidth - the initial width of this frameheight - the initial height of this frametitle - the initial title of this frameHeadlessExceptionpublic Frame(int width,
int height,
String title)
throws HeadlessException
Frame with the given size and with the
top-left corner of the display as location.width - the initial width of this frameheight - the initial height of this frametitle - the initial title of this frameHeadlessExceptionpublic Frame(String title) throws HeadlessException
Frame with width 640 and height 480 in pixels
and with the top-left corner of the display as location.title - the initial title of this frameHeadlessExceptionpublic void addToCanvas(Component comp)
Canvas.add(Component).comp - the component to addpublic void addToCanvas(Component... comps)
Canvas.add(Component[]).comps - the components to addpublic void close()
public Canvas getCanvas()
public void setCanvas(Canvas canvas)
canvas - the new canvaspublic void setCenterLocation()
public final void setContentPane(Container contentPane)
Canvas as content panes.setContentPane in interface RootPaneContainersetContentPane in class JFramepublic void setHeight(int height)
height - the new heightpublic void setLocation(int x,
int y)
setLocation in class Componentpublic void setLocation(Point p)
setLocation in class Componentpublic void setVisible(boolean b)
setVisible in class Windowpublic void setWidth(int width)
width - new width