Here you can find the source of setTextComponentTransparent( JTextComponent paramJTextComponent)
public static void setTextComponentTransparent( JTextComponent paramJTextComponent)
//package com.java2s; import javax.swing.*; import javax.swing.text.JTextComponent; public class Main { public static void setTextComponentTransparent( JTextComponent paramJTextComponent) { paramJTextComponent.setOpaque(false); paramJTextComponent.putClientProperty("Synthetica.opaque", Boolean.valueOf(false)); paramJTextComponent.putClientProperty( "Nimbus.Overrides.InheritDefaults", Boolean.valueOf(false)); paramJTextComponent.putClientProperty("Nimbus.Overrides", new UIDefaults()); }/*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 component the text component to be set to transparent. * @deprecated replaced by {@link #setComponentTransparent(javax.swing.JComponent)}. */ @Deprecated public static void setTextComponentTransparent(JComponent component) { setComponentTransparent(component); } /** * 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 component the text component to be set to transparent. */ public static void setComponentTransparent(JComponent component) { component.setOpaque(false); // add this for the Synthetica component.putClientProperty("Synthetica.opaque", false); // add this for Nimbus to disable all the painting of a component in Nimbus component.putClientProperty("Nimbus.Overrides.InheritDefaults", false); component.putClientProperty("Nimbus.Overrides", new UIDefaults()); } }