This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204893 - Flickering of UI with strange LaF while creating new form
Summary: Flickering of UI with strange LaF while creating new form
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 14:43 UTC by Tomas Danek
Modified: 2011-11-10 10:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (373.30 KB, image/png)
2011-11-09 14:43 UTC, Tomas Danek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2011-11-09 14:43:38 UTC
Created attachment 113050 [details]
screenshot

Product Version: NetBeans IDE Dev (Build 201111080600)
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02-383
System: Mac OS X version 10.7.2 running on x86_64; MacRoman; en_US (nb)
User directory: /tmp/ud3
Cache directory: /tmp/ud3/var/cache
----------------
- start with fresh userdir
- create new java app
- create new jframe form
- during initialization of created form whole main window starts to flicker and is being switched to some weird LaF for a while. See screenshot.
Comment 1 Jan Stola 2011-11-10 10:40:37 UTC
The screenshot shows early stages of progress dialog shown during updating of project's classpath. The message of this dialog is loaded asynchronously (I assume), that's why it is not shown yet. When you try to reproduce this issue then you can see that it says 'Updating project classpath'.

The mist behind this progress dialog is a normal feature of Progress API. The purple/yellow colors of the tabs are the only thing that is not as designed (i.e., the only thing that can and should be fixed).

First of all, let me explain why the mentioned steps lead to this problem on Mac OS only. There is a problem in the default look and feel on Mac that makes GroupLayout from JDK 6 almost unusable. Hence, we try to avoid it and use Swing Layout Extensions library by default on Mac, see issue 175597. We use GroupLayout from JDK on other platforms by default. Hence, there is no classpath update there. On the other hand, you can force usage of the library on other platforms as well. So, you can reproduce this issue there by switching Layout Generation Style property in Tools > Options > Miscellaneous > GUI Builder to Swing Layout Extensions Library (before creation of the form).

The progress dialog has been introduced recently to solve some slowness issue, see 198840. Unfortunately, the progress dialog is shown in GUI Builder's LAF block, i.e., when some NetBeans-specific settings are removed from UIDefaults (to avoid their propagation into the designer area of GUI Builder). This is the root cause of the strange colors on the attached screenshot.

We shouldn't show the progress dialog in GUI Builder's LAF block.
Comment 2 Jan Stola 2011-11-10 10:49:57 UTC
I have found two major places where the progress dialog was shown in GUI Builder's LAF block:

* addition of Swing Layout Extensions library
- we never load these classes from project's classpath. The library is added there just to make sure that the project is compilable. So, there is no need for synchronous update. I have modified this classpath update to happen asynchronously (outside event-dispatch thread), i.e., without any progress dialog shown.

* update of project classpath when a custom bean is being added into the form
- we need a synchronous update in this case because we will load the class of the bean from project classpath. I have modified the corresponding code to update the classpath before it enter's the LAF block (where the class of the bean is loaded).

Modified files: http://hg.netbeans.org/jet-main/rev/f755215d3115