Link Details

Link 31383 thumbnail
User 111696 avatar

By bloid
via pushing-pixels.org
Published: Jul 23 2007 / 11:01

SwingX features a very useful API on the JXPanel. The setAlpha allows setting the alpha (translucency / opacity) value for the panel and all its children. For example, if you want all the child components to be painted with 50% translucency, call myJxPanel.setAlpha(0.5f) and you’re done. As a side note, you can have nested JXPanels; in this case the lowest value wins (see the implementation of JXPanel.getEffectiveAlpha). So, if the outer panel has 0.6 alpha, and the inner panel has 0.4 alpha, the children of the inner panel will be painted with 40% opacity (not 0.6*0.4 = 24% opacity).
  • 8
  • 0
  • 703
  • 103

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (0)