Overview

A simple JPanel extension that adds translucency support. This component and all of its content will be displayed with the specified "alpha" transluscency property value. It also supports the Painter API.

Author(s):

General Methods

accesstypenameparameters

[show]methods inherited from org.jdesktop.swingx.JXPanel

paint, paintComponent,

[show]methods inherited from javax.swing.JPanel

paramString, updateUI,

[show]methods inherited from java.awt.Component

action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate,

[show]methods inherited from java.lang.Object

clone, equals, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait,

Fields

staticaccesstypename

Constructors

accessnameparameters
publicJXPanel ()
publicJXPanel (boolean isDoubleBuffered, )
publicJXPanel (LayoutManager layout, )
publicJXPanel (LayoutManager layout, boolean isDoubleBuffered, )

public JXPanel ()

Creates a new instance of JXPanel

Parameters

    Properties

    nametypedescriptionget/setaccessinheritedbound
    effectiveAlphafloat-----public----
    scrollableUnitIncrementint-----public----
    inheritAlphaboolean-----public----
    backgroundPaintervoid-----public----
    scrollableBlockIncrementint-----public----
    scrollableTracksViewportWidthboolean-----public----
    foregroundPaintervoid-----public----
    preferredScrollableViewportSizeDimension-----public----
    scrollableTracksViewportHeightboolean-----public----
    painterSetPainterSet-----public----
    alphavoid-----public----

    [show]properties inherited from javax.swing.JPanel

    accessibleContext , uI , uIClassID ,

    [show]properties inherited from java.lang.Object

    class ,

    effectiveAlpha

    public float getEffectiveAlpha ()

    Unlike other properties, alpha can be set on a component, or on one of its parents. If the alpha of a parent component is .4, and the alpha on this component is .5, effectively the alpha for this component is .4 because the lowest alpha in the heirarchy "wins"

    Parameters

      scrollableUnitIncrement

      backgroundPainter

      public void setBackgroundPainter (Painter p, )

      Specifies a Painter to use to paint the background of this JXPanel. If p is not null, then setOpaque(false) will be called as a side effect. A component should not be opaque if painters are being used, because Painters may paint transparent pixels or not paint certain pixels, such as around the border insets.

      Parameters
      • p

      scrollableBlockIncrement

      scrollableTracksViewportWidth

      public void setScrollableTracksViewportWidth (boolean scrollableTracksViewportWidth, )

      Parameters
      • scrollableTracksViewportWidth The scrollableTracksViewportWidth to set.

      foregroundPainter

      public void setForegroundPainter (Painter p, )

      Specifies a Painter to use to paint the background of this JXPanel. If p is not null, then setOpaque(false) will be called as a side effect. A component should not be opaque if painters are being used, because Painters may paint transparent pixels or not paint certain pixels, such as around the border insets.

      Parameters
      • p

      preferredScrollableViewportSize

      scrollableTracksViewportHeight

      public void setScrollableTracksViewportHeight (boolean scrollableTracksViewportHeight, )

      Parameters
      • scrollableTracksViewportHeight The scrollableTracksViewportHeight to set.

      alpha

      public void setAlpha (float alpha, )

      Set the alpha transparency level for this component. This automatically causes a repaint of the component. TODO add support for animated changes in translucency

      Parameters
      • alpha must be a value between 0 and 1 inclusive.

      Static and Factory Methods