I see that in some cases the window gets hidden/shown when changing
L&Fs (like when switching from Windows to Metal), and in some
it doesn't (Windows <-> Nimbus). The exception is only thrown
in the first case.
This is because the demo disposes and re-creates the frame when
switching to a L&F which can/can't render its decorations (see
test/ribbon/BasicCheckRibbon.java):
if (canBeDecoratedByLAF == wasDecoratedByOS) {
boolean wasVisible = frame.isVisible();
frame.setVisible(false);
frame.dispose();
if (!canBeDecoratedByLAF) {
// see the java docs under the method
// JFrame.setDefaultLookAndFeelDecorated(boolean
// value) for description of these 2 lines:
frame.setUndecorated(false);
frame.getRootPane().setWindowDecorationStyle(
JRootPane.NONE);
} else {
frame.setUndecorated(true);
frame.getRootPane().setWindowDecorationStyle(
JRootPane.FRAME);
}
frame.setVisible(wasVisible);
wasDecoratedByOS = !frame.isUndecorated();
}
Nothing illegal here, so the exception is a bug, please file it.
Thanks,
Dmitri
[email protected] wrote:
I am running flamingo ribbon demo (RC4.0) (https://flamingo.dev.java.net/) like this:
"java -cp flamingo.jar;flamingo-tst.jar test.ribbon.BasicCheckRibbon" and
always have exception when switching from WinXP LAF to Metal:
[code]
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Buffers
have not been created
at sun.awt.windows.WComponentPeer.getBackBuffer(Unknown Source)
at java.awt.Component$FlipBufferStrategy.getBackBuffer(Unknown Source)
at java.awt.Component$FlipBufferStrategy.updateInternalBuffers(Unknown
Source)
at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
at java.awt.Component$FlipBufferStrategy.revalidate(Unknown Source)
at java.awt.Component$FlipBufferStrategy.getDrawGraphics(Unknown Source)
at javax.swing.BufferStrategyPaintManager.prepare(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[/code]
It seems that there is a problem with d3d pipeline, because there is no such exception
when running with "-Dsun.java2d.d3d=false".
I am running on the system:
[code]
java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
set J2D_TRACE_LEVEL=3
[I] OS Version = OS_WINXP Pro
[I] CheckAdaptersInfo
[I] ------------------
[I] Adapter Ordinal : 0
[I] Adapter Handle : 0x10001
[I] Description : NVIDIA GeForce 9600 GT
[I] GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll
[I] Vendor Id : 0x10de
[I] Device Id : 0x0622
[I] SubSys Id : 0x34821458
[I] Driver Version : 6.14.11.7474
[I] GUID : {D7B71E3E-4562-11CF-DA6A-891400C2CB35}
[I] D3DPPLM::CheckDeviceCaps: adapter 0: Passed
[I] ------------------
[I] D3DGD_getDeviceCapsNative
[I] D3DContext::InitContext device 0
[I] D3DContext::ConfigureContext device 0
[I] D3DContext::ConfigureContext: successfully created device: 0
[I] D3DContext::InitDevice: device 0
[I] D3DContext::InitDefice: successfully initialized device 0
[/code]
And it is reproduced on my home computer with NVIDIA 7600GS also.
Is this a bug in d3d pipeline? Or there is something wrong with the flamingo
ribbon demo?
[Message sent by forum member 'kamre' (kamre)]
http://forums.java.net/jive/thread.jspa?messageID=328154
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".