SkinLF
Version 1.1

com.l2fprod.gui.grieves.graphics
Class JExternalFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--javax.swing.JWindow
                          |
                          +--com.l2fprod.gui.grieves.graphics.JExternalFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
SkinWindow

public class JExternalFrame
extends javax.swing.JWindow
implements javax.swing.WindowConstants

 Do not remove these comments under penalty of my displeasure.
 

I'm not smart like those GNU guys, so I'll just say briefly that you can pretty much do what you want with this software, except: 1. Sue me if it doesn't work or causes you any problems. 2. Claim that you (or anyone other than me) wrote it. 3. Sell it to anyone.

See my website for more info on JExternalFrame.

JExternalFrame tries to combine the functionality and pluggable L & F of a JInternalFrame with the top-level status of a Window or Frame. You use it just like a JFrame (except I wouldn't recommend doing any fancy stuff with setContentPane, setGlassPane, or setLayeredPane.) Call getContentPane() and set the layout, add components, etc. Then, throw it out on your screen somewhere with a pack() and a setVisible(true).

You can also programmatically minimize it & iconize it just like a JInternalFrame using setIcon() & setMaximum(). Unfortunately, since it's really just a JWindow in disguise, it won't actually go down to the task bar in Windows 95/98/NT like a JFrame will.

Because the window is drawn using a JInternalFrame, it will use whatever your current Look & Feel is for a JInternalFrame. This means it can look like a Metal Frame. Pretty cool, huh?

Version:
f
Author:
Daniel P Grieves
See Also:
JInternalFrame, Serialized Form

Field Summary
static int SCREEN_HEIGHT
          Used for maximizing the frame
static int SCREEN_WIDTH
          Used for maximizing the frame
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JExternalFrame()
          This method works more like the zero-arg constructor for JFrame than JInternalFrame because I replace JFrames with it.
JExternalFrame(java.lang.String title)
          Make a JExternalFrame with the given title; resizable, closable, maximizable, iconifiable
JExternalFrame(java.lang.String title, boolean resizable)
          Like above, but can control resizability
JExternalFrame(java.lang.String title, boolean resizable, boolean closable)
          Like above, but can control closability
JExternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable)
          Like above, but can control maximizability
JExternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
          Like above, but can control iconifiability
 
Method Summary
 java.awt.Container getContentPane()
          Use the container returned by getContentPane() to put your stuff in.
 int getDefaultCloseOperation()
          What should the frame do when the user clicks the close button? This should be one of the constants from WindowConstants.
 javax.swing.Icon getFrameIcon()
          What icon is the frame currently displaying?
 javax.swing.JMenuBar getJMenuBar()
          The JMenuBar this frame is currently showing.
 java.lang.String getTitle()
          The title of the frame
 boolean isClosable()
          Is the frame closable?
 boolean isClosed()
          Is the frame currently closed?
 boolean isIcon()
          Is the frame iconified?
 boolean isIconifiable()
          Can the frame be iconified?
 boolean isMaximizable()
          Can the frame be maximized?
 boolean isMaximum()
          Is the frame maximized?
 boolean isResizable()
          Can the frame be resized?
 boolean isSelected()
          Is the frame currently selected?
 void pack()
          Do that packing thing.
 void setBounds(int x, int y, int width, int height)
          Set the size and location of the frame
 void setClosable(boolean Closable)
          Set whether the frame can be closed.
 void setClosed(boolean Closed)
          Close the window.
 void setDefaultCloseOperation(int dco)
          Tell the frame what action it should take when the user tries to close it.
 void setFrameIcon(javax.swing.Icon icon)
          Set the icon the frame should display
 void setIcon(boolean Icon)
          Iconify / Deiconify the frame.
 void setIconifiable(boolean Iconifiable)
           
 void setJMenuBar(javax.swing.JMenuBar m)
          Give the frame a menu bar to use.
 void setMaximizable(boolean Maximizable)
          Set whether the frame can be maximized.
 void setMaximum(boolean Maximum)
          Maximize / Demaximize the frame.
 void setResizable(boolean Resizable)
          Set whether the frame can be resized.
 void setSelected(boolean Selected)
          Set whether the frame is selected.
 void setTitle(java.lang.String title)
          Change the title of the frame
 void setVisible(boolean visible)
          Show / hide the frame
 
Methods inherited from class javax.swing.JWindow
getAccessibleContext, getGlassPane, getLayeredPane, getRootPane, remove, setContentPane, setGlassPane, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCREEN_WIDTH

public static final int SCREEN_WIDTH
Used for maximizing the frame


SCREEN_HEIGHT

public static final int SCREEN_HEIGHT
Used for maximizing the frame

Constructor Detail

JExternalFrame

public JExternalFrame()
This method works more like the zero-arg constructor for JFrame than JInternalFrame because I replace JFrames with it. No title, resizable, closable, maximizable, iconifiable


JExternalFrame

public JExternalFrame(java.lang.String title)
Make a JExternalFrame with the given title; resizable, closable, maximizable, iconifiable

Parameters:
title - Put this title on top of the frame

JExternalFrame

public JExternalFrame(java.lang.String title,
                      boolean resizable)
Like above, but can control resizability

Parameters:
title - Put this title on top of the frame
resizable - Can the user resize the window?

JExternalFrame

public JExternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable)
Like above, but can control closability

Parameters:
title - Put this title on top of the frame
resizable - Can the user resize the window?
closable - Can the user close the window?

JExternalFrame

public JExternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable)
Like above, but can control maximizability

Parameters:
title - Put this title on top of the frame
resizable - Can the user resize the window?
closable - Can the user close the window?
maximizable - Can the user maximize the window?

JExternalFrame

public JExternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable,
                      boolean iconifiable)
Like above, but can control iconifiability

Parameters:
title - Put this title on top of the frame
resizable - Can the user resize the window?
closable - Can the user close the window?
maximizable - Can the user maximize the window?
iconifiable - Can the user iconify the window?
Method Detail

getContentPane

public java.awt.Container getContentPane()
Use the container returned by getContentPane() to put your stuff in.

Specified by:
getContentPane in interface javax.swing.RootPaneContainer
Overrides:
getContentPane in class javax.swing.JWindow
Returns:
the Container where all your stuff should go.

getDefaultCloseOperation

public int getDefaultCloseOperation()
What should the frame do when the user clicks the close button? This should be one of the constants from WindowConstants.

Returns:
What the frame should do when the user tries to close it.
See Also:
WindowConstants

setDefaultCloseOperation

public void setDefaultCloseOperation(int dco)
Tell the frame what action it should take when the user tries to close it. This should be one of the constants from WindowConstants

Parameters:
dco - The new Default Close Operation
See Also:
WindowConstants

getJMenuBar

public javax.swing.JMenuBar getJMenuBar()
The JMenuBar this frame is currently showing.


getTitle

public java.lang.String getTitle()
The title of the frame


isClosable

public boolean isClosable()
Is the frame closable?


isClosed

public boolean isClosed()
Is the frame currently closed?


isIcon

public boolean isIcon()
Is the frame iconified?


isIconifiable

public boolean isIconifiable()
Can the frame be iconified?


isMaximizable

public boolean isMaximizable()
Can the frame be maximized?


isMaximum

public boolean isMaximum()
Is the frame maximized?


isResizable

public boolean isResizable()
Can the frame be resized?


isSelected

public boolean isSelected()
Is the frame currently selected?


setClosable

public void setClosable(boolean Closable)
Set whether the frame can be closed.


setClosed

public void setClosed(boolean Closed)
               throws java.beans.PropertyVetoException
Close the window. I'm not sure this is a good idea. You should probably use setVisible instead.

Throws:
java.beans.PropertyVetoException - If it wants to.

setIcon

public void setIcon(boolean Icon)
             throws java.beans.PropertyVetoException
Iconify / Deiconify the frame.

Throws:
java.beans.PropertyVetoException - If it wants to.

setMaximum

public void setMaximum(boolean Maximum)
                throws java.beans.PropertyVetoException
Maximize / Demaximize the frame.

Throws:
java.beans.PropertyVetoException - If it wants to.

setMaximizable

public void setMaximizable(boolean Maximizable)
Set whether the frame can be maximized.


setIconifiable

public void setIconifiable(boolean Iconifiable)

setResizable

public void setResizable(boolean Resizable)
Set whether the frame can be resized.


setSelected

public void setSelected(boolean Selected)
                 throws java.beans.PropertyVetoException
Set whether the frame is selected.

Throws:
java.beans.PropertyVetoException - If it wants to.

setJMenuBar

public void setJMenuBar(javax.swing.JMenuBar m)
Give the frame a menu bar to use.


setTitle

public void setTitle(java.lang.String title)
Change the title of the frame


getFrameIcon

public javax.swing.Icon getFrameIcon()
What icon is the frame currently displaying?


setFrameIcon

public void setFrameIcon(javax.swing.Icon icon)
Set the icon the frame should display


pack

public void pack()
Do that packing thing.

Overrides:
pack in class java.awt.Window

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Set the size and location of the frame

Overrides:
setBounds in class java.awt.Component

setVisible

public void setVisible(boolean visible)
Show / hide the frame

Overrides:
setVisible in class java.awt.Component

SkinLF
Version 1.1

www.L2FProd.com
© 2000-2001 L2FProd.com