|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.neu.ccs.gui.JPTFrame
JPTFrame extends the Java JFrame class for
the following purposes.
JFrame that is packed
and opened automatically.This class adds two new default close operations
to the JFrame class:
EXIT_ON_CLOSE: exits the
Java Virtual Machine when this frame is disposedEXIT_ON_CLOSE_IF_LAST: exits the
Java Virtual Machine when the last
instance of JPTFrame is disposedWe now make some comments that explain the historical evolution of the methods in this class.
The static convenience methods createQuickJPTFrame
may be used to create and display a JPTFrame that is
automatically packed and placed in a desired location.
In version 2.3.2, the various createQuickJPTFrame
methods were changed to accept a general Object rather
than requiring a Component. The object is converted
into a component using the tools of ComponentFactory.
In version 2.3.4, methods named frame were introduced
as less verbose versions of createQuickJPTFrame. At the
same time, these methods make the object being framed the first
argument which is, in retrospect, a much more natural design.
The same static frame methods have also been introduced into
the class JPF as convenience methods for experimentation.
The class DisplayPanel has a parallel set of member
frame methods that permit a DisplayPanel to
frame itself. We call this ability self actualization.
In 2.4.0, the methods normal, iconify,
maximize, and toggle were introduced to
permit easy algorithmic control of whether a frame is in its normal
state, is maximized, or is iconfied.
In 2.7.0, public static methods were added to permit access to the
counter object that counts the number of open JPTFrame objects. The
purpose of this change is to support DirectApplet class.
The difficulty resolved is this. An applet can open frames. The
JPT policy is to exit if the last open frame is closed. However, in
prior releases, this did not count the applet itself. Hence, if the
applet opened a frame and the user closed the frame then the applet
itself might exit. By making the counter increment and decrement
methods public, an applet can add itself into the count of open
frames on initialization and remove itself when it is destroyed. It
is a serious error to use these static methods for any other purpose.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
| Nested classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
| Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected int |
closeOperation
The window closing operation for this frame. |
protected static XInt |
counter
Shared counter of JPTFrames in existence. |
static int |
DEFAULT_CLOSE_OPERATION
The default window closing operation for a JPTFrame. |
static int |
EXIT_ON_CLOSE
Value designating that the running application should be exited when this frame is disposed. |
static int |
EXIT_ON_CLOSE_IF_LAST
Value designating that the running application should be exited when the last JPTFrame
is disposed. |
private static Insets |
INSETS
The default insets for the frame in the screen window, namely, 50, 50, 50, 50. |
protected Insets |
screen_insets
The current insets to use in setLocation calls
that do not provide explicit insets. |
| Fields inherited from class javax.swing.JFrame |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
CROSSHAIR_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_CURSOR |
| Fields inherited from class java.awt.Window |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JPTFrame()
Constructs a frame with no title. |
|
JPTFrame(String title)
Constructs a frame with the given title. |
|
| Method Summary | |
void |
addNotify()
Resizes the frame upon creation of its peer window to make its contents the proper size regardless of platform specific insets size. |
void |
center()
Centers the frame on the user screen relative to the current screen insets. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object)
Returns a new JPTFrame
with the given title and content pane
that is packed and centered on the screen. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
Insets insets)
Returns a new JPTFrame
with the given title and content pane
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
int location)
Returns a new JPTFrame
with the given title and content pane
that is packed and located on the screen
in the given screen location. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
int location,
Insets insets)
Returns a new JPTFrame
with the given title and content pane
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
LayoutManager layout)
Returns a new JPTFrame
with the given title, content pane,
and layout manager
that is packed and centered on the screen. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
Insets insets)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
int location)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and located on the screen
in the given screen location. |
static JPTFrame |
createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
int location,
Insets insets)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame. |
static void |
decrementCounter()
Decrements the shared counter object that counts the number of open JPTFrame and DirectApplet
objects. |
void |
dispose()
Disposes of the resources used by this frame and decrements the count of JPTFrame and DirectApplet
objects in existence. |
static JPTFrame |
frame(Object object)
Returns a new JPTFrame
with the given content pane and blank title
that is packed and centered on the screen. |
static JPTFrame |
frame(Object object,
int location)
Returns a new JPTFrame
with the given content pane and blank title
that is packed and located on the screen
in the given screen location. |
static JPTFrame |
frame(Object object,
String title)
Returns a new JPTFrame
with the given content pane and title
that is packed and centered on the screen. |
static JPTFrame |
frame(Object object,
String title,
Insets insets)
Returns a new JPTFrame
with the given content pane and title
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame. |
static JPTFrame |
frame(Object object,
String title,
int location)
Returns a new JPTFrame
with the given content pane and title
that is packed and located on the screen
in the given screen location. |
static JPTFrame |
frame(Object object,
String title,
int location,
Insets insets)
Returns a new JPTFrame
with the given content pane and title
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame. |
protected static XInt |
getCounter()
Returns the shared counter object that counts the number of open JPTFrame and DirectApplet
objects. |
int |
getDefaultCloseOperation()
Returns the window close operation for this frame. |
static int |
getJPTFrameCount()
Returns the number of JPTFrames in existence. |
Insets |
getScreenInsets()
Returns a copy of the current screen insets used in calls to setLocation(int). |
void |
iconify()
Set this frame to its ICONIFIED state. |
static void |
incrementCounter()
Increments the shared counter object that counts the number of open JPTFrame and DirectApplet
objects. |
void |
installWindowAdapter()
Installs the window adapter for this frame. |
void |
maximize()
Set this frame to its MAXIMIZED_BOTH state. |
void |
normal()
Set this frame to its NORMAL state. |
void |
setDefaultCloseOperation(int operation)
Sets the window closing operation to the operation specified by the given value. |
void |
setLocation(int location)
Sets the location of this frame on the user screen to the location representing the logical screen location of the given compass direction; uses the current screen insets saved with this frame. |
void |
setLocation(int location,
Insets insets)
Sets the location of this frame on the user screen to the location representing the logical screen location of the given compass direction; the given insets bound the frame away from the borders of the screen and also replace the current screen insets for future calls of setLocation(int) on the frame. |
void |
toggle()
If the current state of the frame is not normal, then make it normal otherwise iconify. |
| Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
public static final int EXIT_ON_CLOSE
EXIT_ON_CLOSE, is mentioned in
the API documentation for JDK v1.3, but is not implemented
in any version of the JDK.
setDefaultCloseOperation(int),
Constant Field Valuespublic static final int EXIT_ON_CLOSE_IF_LAST
JPTFrame
is disposed.
setDefaultCloseOperation(int),
Constant Field Valuespublic static final int DEFAULT_CLOSE_OPERATION
JPTFrame.
setDefaultCloseOperation(int),
Constant Field Valuesprivate static final Insets INSETS
protected static XInt counter
JPTFrames in existence.
protected int closeOperation
setDefaultCloseOperation(int)protected Insets screen_insets
setLocation calls
that do not provide explicit insets.
| Constructor Detail |
public JPTFrame()
JPTFrame(String)public JPTFrame(String title)
title - the title for this frameJPTFrame()| Method Detail |
public void center()
Component.setLocation(int, int)public void setLocation(int location)
Sets the location of this frame on the user screen to the location representing the logical screen location of the given compass direction; uses the current screen insets saved with this frame.
For best results, this method should be called after the
JPTFrame is made visible. The reason for this
is that, in making the frame visible, Java calls the method
addNotify() and this method has been overridden
in this class to adjust the frame size to take into account
the insets of the native window in order to get the true size.
The methods createQuickJPTFrame are designed
to set the location after the frame is made visible.
This method does not anchor this frame in the given logical
position; calling this method leads to a call of the standard
setLocation(int, int) method.
The location is given by one of the following constants in
the interface SwingConstants that are included
for convenience in the interface JPTConstants as
well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe DEFAULT location is the CENTER
location.
If the given compass direction is not valid, the location
is set to the DEFAULT location. This is a change
in how to handle an erroneous parameter that was introduced in
version 2.3.
location - the compass direction representing the desired locationsetLocation(int, Insets),
center(),
Component.setLocation(int, int),
JPTConstants.DEFAULT
public void setLocation(int location,
Insets insets)
Sets the location of this frame on the user screen to the
location representing the logical screen location of the
given compass direction;
the given insets bound the frame away from the borders of the
screen and also replace the current screen insets for future
calls of setLocation(int) on the frame.
For best results, this method should be called after the
JPTFrame is made visible. The reason for this
is that, in making the frame visible, Java calls the method
addNotify() and this method has been overridden
in this class to adjust the frame size to take into account
the insets of the native window in order to get the true size.
The methods createQuickJPTFrame are designed
to set the location after the frame is made visible.
This method does not anchor this frame in the given logical
position; calling this method leads to a call of the standard
setLocation(int, int) method.
The location is given by one of the following constants in
the interface SwingConstants that are included
for convenience in the interface JPTConstants as
well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe DEFAULT location is the CENTER
location.
If the given compass direction is not valid, the location
is set to the DEFAULT location. This is a change
in how to handle an erroneous parameter that was introduced in
version 2.3.
The insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null, then the current
screen insets revert to the default of 50, 50, 50, 50.
location - the compass direction representing the desired locationinsets - the screen insets to use to adjust the locationsetLocation(int),
center(),
Component.setLocation(int, int),
JPTConstants.DEFAULTpublic Insets getScreenInsets()
setLocation(int).
setLocation(int)public void addNotify()
public void setDefaultCloseOperation(int operation)
Sets the window closing operation to the operation specified by the given value.
If the given value is not valid, the current window closing operation is not changed.
operation - the value of the operation to perform
when the window is closedgetDefaultCloseOperation(),
WindowConstants.DO_NOTHING_ON_CLOSE,
WindowConstants.HIDE_ON_CLOSE,
WindowConstants.DISPOSE_ON_CLOSE,
EXIT_ON_CLOSE,
EXIT_ON_CLOSE_IF_LAST,
JPTConstants.DEFAULTpublic int getDefaultCloseOperation()
setDefaultCloseOperation(int),
WindowConstants.DO_NOTHING_ON_CLOSE,
WindowConstants.HIDE_ON_CLOSE,
WindowConstants.DISPOSE_ON_CLOSE,
EXIT_ON_CLOSE,
EXIT_ON_CLOSE_IF_LASTpublic static int getJPTFrameCount()
JPTFrames in existence.
EXIT_ON_CLOSE_IF_LASTpublic void dispose()
Disposes of the resources used by this frame and decrements
the count of JPTFrame and DirectApplet
objects in existence.
public void normal()
Set this frame to its NORMAL state.
Equivalent to the call setExtendedState(JFrame.NORMAL).
public void iconify()
Set this frame to its ICONIFIED state.
Equivalent to the call setExtendedState(JFrame.ICONIFIED).
public void maximize()
Set this frame to its MAXIMIZED_BOTH state.
Equivalent to the call setExtendedState(JFrame.MAXIMIZED_BOTH).
public void toggle()
If the current state of the frame is not normal, then make it normal otherwise iconify.
public static JPTFrame createQuickJPTFrame(String title,
Object object)
Returns a new JPTFrame
with the given title and content pane
that is packed and centered on the screen.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
title - the title for the frameobject - the object to frame
public static JPTFrame createQuickJPTFrame(String title,
Object object,
int location)
Returns a new JPTFrame
with the given title and content pane
that is packed and located on the screen
in the given screen location.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WEST
title - the title for the frameobject - the object to framelocation - the compass direction representing the desired location
public static JPTFrame createQuickJPTFrame(String title,
Object object,
Insets insets)
Returns a new JPTFrame
with the given title and content pane
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
title - the title for the frameobject - the object to frameinsets - the screen insets to use to adjust the location
public static JPTFrame createQuickJPTFrame(String title,
Object object,
int location,
Insets insets)
Returns a new JPTFrame
with the given title and content pane
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
title - the title for the frameobject - the object to framelocation - the compass direction representing the desired locationinsets - the screen insets to use to adjust the location
public static JPTFrame createQuickJPTFrame(String title,
Object object,
LayoutManager layout)
Returns a new JPTFrame
with the given title, content pane,
and layout manager
that is packed and centered on the screen.
If the given object is null,
no contents are added to the frame.
If the given layout manager is null,
the default layout for the content pane of a
JFrame is used.
title - the title for the frameobject - the object to framelayout - the layout manager for the content pane
public static JPTFrame createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
int location)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and located on the screen
in the given screen location.
If the given object is null,
no contents are added to the frame.
If the given layout manager is null,
the default layout for the content pane of a
JFrame is used.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WEST
title - the title for the frameobject - the object to framelayout - the layout manager for the content panelocation - the compass direction representing the desired location
public static JPTFrame createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
Insets insets)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame.
If the given object is null,
no contents are added to the frame.
If the given layout manager is null,
the default layout for the content pane of a
JFrame is used.
The insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
title - the title for the frameobject - the object to framelayout - the layout manager for the content paneinsets - the screen insets to use to adjust the location
public static JPTFrame createQuickJPTFrame(String title,
Object object,
LayoutManager layout,
int location,
Insets insets)
Returns a new JPTFrame
with the given title, content pane,
and layout manager,
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame.
If the given object is null,
no contents are added to the frame.
If the given layout manager is null,
the default layout for the content pane of a
JFrame is used.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
title - the title for the frameobject - the object to framelayout - the layout manager for the content panelocation - the compass direction representing the desired locationinsets - the screen insets to use to adjust the locationpublic static JPTFrame frame(Object object)
Returns a new JPTFrame
with the given content pane and blank title
that is packed and centered on the screen.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The method call frame(object)
is the same as the method call
createQuickJPTFrame("",object).
object - the object to frame
public static JPTFrame frame(Object object,
int location)
Returns a new JPTFrame
with the given content pane and blank title
that is packed and located on the screen
in the given screen location.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe method call frame(object,location)
is the same as the method call
createQuickJPTFrame("",object,location).
object - the object to framelocation - the compass direction representing the desired location
public static JPTFrame frame(Object object,
String title)
Returns a new JPTFrame
with the given content pane and title
that is packed and centered on the screen.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
This method is the same as
createQuickJPTFrame(String,Object)
but places the Object argument first
and is less verbose.
object - the object to frametitle - the title for the frame
public static JPTFrame frame(Object object,
String title,
int location)
Returns a new JPTFrame
with the given content pane and title
that is packed and located on the screen
in the given screen location.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThis method is the same as
createQuickJPTFrame(String,Object,int)
but places the Object argument first
and is less verbose.
object - the object to frametitle - the title for the framelocation - the compass direction representing the desired location
public static JPTFrame frame(Object object,
String title,
Insets insets)
Returns a new JPTFrame
with the given content pane and title
that is packed and centered on the screen;
the given insets replace the current insets for
future calls of setLocation(int)
on the frame.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
This method is the same as
createQuickJPTFrame(String,Object,Insets)
but places the Object argument first
and is less verbose.
object - the object to frametitle - the title for the frameinsets - the screen insets to use to adjust the location
public static JPTFrame frame(Object object,
String title,
int location,
Insets insets)
Returns a new JPTFrame
with the given content pane and title
that is packed and located on the screen
in the given screen location;
the given insets bound the frame away from
the borders of the screen and also replace
the current insets for future calls of
setLocation(int) on the frame.
If the given object is null,
no contents are added to the frame.
The layout of the content pane is set
to CenterLayout.
The location is given by one of the following
constants in the interface SwingConstants
that are included for convenience in the interface
JPTConstants as well:
CENTERNORTHNORTH_EASTEASTSOUTH_EASTSOUTHSOUTH_WESTWESTNORTH_WESTThe insets provide a margin from the edge of the screen so the frame will avoid being placed underneath OS objects such as menu bars or program selection widgets.
If the given insets is null,
then the insets are set to the default of
50, 50, 50, 50.
This method is the same as
createQuickJPTFrame(String,Object,int,Insets)
but places the Object argument first
and is less verbose.
object - the object to frametitle - the title for the framelocation - the compass direction representing the desired locationinsets - the screen insets to use to adjust the locationprotected static XInt getCounter()
Returns the shared counter object that counts the number
of open JPTFrame and DirectApplet
objects.
public static void incrementCounter()
Increments the shared counter object that counts the number
of open JPTFrame and DirectApplet
objects.
This method though public is intended for internal use by JPT and should not be used for other purposes.
public static void decrementCounter()
Decrements the shared counter object that counts the number
of open JPTFrame and DirectApplet
objects.
This method though public is intended for internal use by JPT and should not be used for other purposes.
public void installWindowAdapter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||