|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--edu.princeton.swing.PImagePanel
PImagePanel is like a JPanel, except that its background can be set to an image.
| Field Summary |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
PImagePanel()
Constructs a new PImagePanel. |
|
PImagePanel(Icon background)
Constructs a new PImagePanel. |
|
PImagePanel(Icon background,
LayoutManager layout)
Constructs a new PImagePanel. |
|
| Method Summary | |
Icon |
getBackgroundIcon()
Gets the background icon. |
Dimension |
getPreferredSize()
Override javax.swing.JComponent's getPreferredSize method so that the background image is taken into consideration. |
protected void |
paintComponent(Graphics g)
Override javax.swing.JComponent's paintComponent method to paint the background appropriately. |
void |
setBackgroundIcon(Icon background)
Sets the background icon. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PImagePanel(Icon background,
LayoutManager layout)
public PImagePanel(Icon background)
public PImagePanel()
| Method Detail |
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic Icon getBackgroundIcon()
public void setBackgroundIcon(Icon background)
background - The Icon to be displayed in the background of this panel.protected void paintComponent(Graphics g)
paintComponent in class JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||