Skip to main content

Nimbus buttons flicker when mouse exits?

5 replies [Last post]
cowwoc
Offline
Joined: 2003-08-24
Points: 0

Hi,

Where are we supposed to discuss potential Nimbus bugs? I am using Java6 update 10 and I noticed when I move the mouse off a button there is a horizontal line about 3/4 of the way down the button height "flickers" for a few ms and then disappears.

I don't know if this is a painting bug (that is, working as designed but doesn't look nice visually) or whether it is a Java2D rendering issue.

This problem is more noticeable on larger buttons. Does anyone else see this?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
trembovetski
Offline
Joined: 2003-12-31
Points: 0

What's the platform? If it's windows, does disabling the d3d pipeline help? (-Dsun.java2d.d3d=false).

Could you post a complete test case reproducing the problem?

Dmitri

cowwoc
Offline
Joined: 2003-08-24
Points: 0

It looks like I can reproduce the problem on pretty much any L&F, though it's more obvious in ones that fade colors in and out like Nimbus (less so in Windows L&F).

I reproduced the problem both under Java6 update 10 and Java7 b39. Disabling the d3d pipeline didn't help.

To reproduce, create a JButton with a large height then quickly pass the mouse back and forth on and off the button (causing it to fade in and out). You will notice striations near the bottom of the button because this is where most of the color change occurs.

I'm not sure whether this is a normal visual effect (i.e. something to do with our eyes) or whether the button really is being painted in chunks. In any case, this issue caught my eyes fairly easily even on normal-sized nimbus buttons. Whenever the mouse would leave a JButton my eyes would notice a "unsmooth fade". Hopefully you will be able to reproduce this on your end as well.

trembovetski
Offline
Joined: 2003-12-31
Points: 0

I think this may be because we are not synchronized to vertical retrace. So what you're seeing is "tearing" when we update the screen from one state to another.

Using vsync for Swing is something we're considering for 1.7. It's not as trivial as it sounds..

Dmitri

cowwoc
Offline
Joined: 2003-08-24
Points: 0

Vertical retrace sounds about right... Is this the corresponding BugParade issue? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378181

Thanks,
Gili

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Looks like it may be it.

There's some rudimentary support for creating v-synced BufferStrategies in 6u10 but it can't be used w/o using private api:
http://bugs.sun.com/search.do?process=1&category=&bugStatus=1%2C2%2C3%2C...

The idea is to expose the api in 7.

Dmitri