Here you can find the source of setTextComponentTransparent( JTextComponent textComponent)
Parameter | Description |
---|---|
textComponent | the text component to be set to transparent. |
public static void setTextComponentTransparent( JTextComponent textComponent)
//package com.java2s; import javax.swing.*; import javax.swing.text.JTextComponent; public class Main { /**/*from w w w. j a v a 2 s. c o m*/ * Sets the text component transparent. It will call setOpaque(false) and also set client property for certain L&Fs * in case the L&F doesn't respect the opaque flag. * * @param textComponent the text component to be set to transparent. */ public static void setTextComponentTransparent( JTextComponent textComponent) { textComponent.setOpaque(false); // add this for the Synthetica textComponent.putClientProperty("Synthetica.opaque", false); // add this for Nimbus to disable all the painting of a component in Nimbus textComponent.putClientProperty("Nimbus.Overrides.InheritDefaults", false); textComponent.putClientProperty("Nimbus.Overrides", new UIDefaults()); } }