View RSS Feed

DuvanSlabbert

Setting JWindow or JFrame Opaque

Rate this Entry
by , 10-17-2011 at 09:31 PM (1978 Views)
Ever tried setting the visibility of a rootpane on your JWindow or JFrame without loosing visibility of the components on that JWindow or JFrame???

Here is a little snippet of code to keep close by as it might come in handy

Java Code:
try {
	Class<?> awtUtilitiesClass = Class.forName("com.sun.awt.AWTUtilities");
	Method method = awtUtilitiesClass.getMethod("setWindowOpaque", Window.class, boolean.class);
	method.invoke(null, /*JFrame or JWindow here*/, b);
} catch (Exception exc) {
	exc.printStackTrace();
}

Submit "Setting JWindow or JFrame Opaque" to Facebook Submit "Setting JWindow or JFrame Opaque" to Digg Submit "Setting JWindow or JFrame Opaque" to del.icio.us Submit "Setting JWindow or JFrame Opaque" to StumbleUpon Submit "Setting JWindow or JFrame Opaque" to Google

Updated 10-19-2011 at 09:34 AM by DuvanSlabbert

Categories
AWT and Swing

Comments