com.jjt.utbeg
Class BorderPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--com.jjt.utbeg.BorderPanel

public class BorderPanel
extends Panel

A Container that allows for empty and line borders around the contained components.

This Container uses a content pane, so any Container methods that would normally be called on this Component should be called on its content pane instead. Example:

     BorderPanel panel = new BorderPanel();
     panel.setLayout( new GridLayout( 1, 1));
     panel.add( new Label( "My Label"));
 
Should, instead, be:
     BorderPanel panel = new BorderPanel();
     panel.getContentPane().setLayout( new GridLayout( 1, 1));
     panel.getContentPane().add( new Label( "My Label"));
 

There are three widths that may be specified: An outer (empty) border width, a colored border width, and an inner (empty) border width.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
Component.AWTTreeLock, Component.NativeInLightFixer
 
Field Summary
private  Color borderColor
           
private  int borderWidth
           
private  Panel contentPane
           
private  int innerInset
           
private  Insets insets
           
private  int outerInset
           
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
BorderPanel()
           
BorderPanel(int outerInset, int borderWidth, int innerInset, Color borderColor)
           
 
Method Summary
private  void createInsets()
           
 Container getContentPane()
           
 Insets getInsets()
           
 void paint(Graphics g)
           
 void setBorderColor(Color newBorderColor)
           
 void setBorderWidth(int newBorderWidth)
           
 void setInnerInsets(int newInnerInset)
           
 void setOuterInsets(int newOuterInset)
           
 
Methods inherited from class java.awt.Panel
addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
, add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

contentPane

private Panel contentPane

borderWidth

private int borderWidth

outerInset

private int outerInset

innerInset

private int innerInset

insets

private Insets insets

borderColor

private Color borderColor
Constructor Detail

BorderPanel

public BorderPanel(int outerInset,
                   int borderWidth,
                   int innerInset,
                   Color borderColor)

BorderPanel

public BorderPanel()
Method Detail

setBorderColor

public void setBorderColor(Color newBorderColor)

setBorderWidth

public void setBorderWidth(int newBorderWidth)

setOuterInsets

public void setOuterInsets(int newOuterInset)

setInnerInsets

public void setInnerInsets(int newInnerInset)

createInsets

private void createInsets()

getInsets

public Insets getInsets()
Overrides:
getInsets in class Container

paint

public void paint(Graphics g)
Overrides:
paint in class Container

getContentPane

public Container getContentPane()