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.
This applies to any 5.0 build on any JDK version When NB are started for first time, the licence agreement dialog is open and waits for user input. But if menawhile user switches to other window, the dialog does not come to foreground and does not have item in taskbar. This leads to situations, when NB does not start and user does not know why. Proper behaviour of the dialog should be blinking item displayed in taskbar.
I do not agree that this is P2 bug. It should be unusal because most of users ougth to use installer. It happens only once and there is no other impact. To add some useful comment: system tray notification can be supported with project that can be found on jdic.java.net. I am no sure about highlighting of app - at least it is unlikely to work on Linux / GNOME.
Marek, please look at this. I guess, you've implemented the current version, haven't you?
Yes I did. License Agreement dialog is modal dialog without parent. The same applies on Import settings dialog. I tested on Linux/Gnome: It works on JDK 1.4.2_09, JDK 6.0 build 55. It does not work (ie. not shown in Window List) on JDK 5.0 u4,5,6 (for update 6 there is build 03). I have now idea why it happens. Trick is to add Frame with size 0 not resizable and use it as owner of modal dialog. It makes sure it is always displayed in Window List. Such solution is not ideal as some actions from Window Manager - like Move - work for original frame not for dialog. Another solution would be to use frame and emulate modal dialog behavior somehow. It could be fragile solution as we would duplicate modality behavior in non modal window. Let me know if solution with zero size frame is acceptable. I will have to test this on more platforms/window managers/JDKs. Looks like regression in JDK (even if I did not find any description of this in javadoc but it works in JDK 1.4.2_09 and JDK 6.0 build 55 but not in JDK 5.0 u4,5,6. I will try to file issue against JDK with simple test case. So this can be viewed as workaround. Any other possible solution/idea is welcome. :)
Downgrading to P3. Justification: Most users will never see the License Agreement dialog during the first start, because they already agreed to it in the installer. The dialog is shown only when NetBeans was installed from a zip archive and started for the first time with a clean userdir. This is not supposed to be a typical scenario. As pointed out by Marek, the Settings Import dialog behaves the same way. This dialog has been around since NB 3.6 and based on the feedback (or lack thereof), it has never seem to cause any problems.
It opens also when NB are started with clean userdir. I can imagine following inexperienced user scenario: "I deleted .netbeans directory and is does not start any more."
Re: "It opens also when NB are started with clean userdir." No, it does not. If the user installs the IDE using the installer and accepts the license there, she will never see the license dialog again no matter how many times she starts with a clean userdir. Please test it. If it didn't work, *that* would be a P2 bug.
On Windows XP it works only with JDK 6.0 (I tested build 54). For JDK 1.4.2_09 and 5.0u4, 5.0u5 dialog is not displayed in Window List. But still you can use Alt-TAB (or any other shortcut used for switching among windows) to see presence of dialog or to activate it. So user is not lots completely. On Mac OSX it works fine (10.4.2 both JDK 1.4.2 and JDK 1.5.0). I filed issue #6338130 to Bugtraq against JDK/Swing. We have 2 possibilities: 1.Close this issue as WONTFIX. 2.Implement workaround with hidden frame as owner for specific JDKs/OS. (It is not appropriate implement it for working combinations as in such cases it makes things worse - some actions from popup menu in Window List do not work correctly.) As this could influence only minority of users (who do not install IDE using installer), there si still possible to switch among windows using Alt-TAB and it works fine in JDK 6.0 I prefer 1.
I tried to improve situation when user starts IDE and selects another app. Unfortunately there is no way how to front dialog when it is opened/displayed and another app is active. requestFocus() and/or toFront() work only among windows from one JVM. It does not have any effect when another app window is activated/in front. (At least on Windows with JDK 5.0u5.) And as there is no item in Window List there is no way how to indicate that dialog is displayed and waits for user input. Closing as WONTFIX. It is JDK/Swing problem. Hopefully it will be fixed in some next update. It works correctly for JDK 6.0 builds. I will give update if I will get any info from Swing team.
Created attachment 26154 [details] Possible patch with 'hidden'frame
I got response form Swing team. JDialog without owner should NOT have item in Window list. It is fixed in JDK 1.6.0-b59. Reopening this. We need to decide how to fix this: 1.Use our own 'hidden' JFrame as owner. Simple but not ideal solution. (Popup menu on Window list item does not work correctly - Move action.) 2.Use JFrame and worker thread to emulate blocking as with modal JDialog. It means also change in core/startup as all methods to show dialog must not be called in AWT thread using invokeAndWait. They will be called from original thread and code will create worker thread. Worker thread will create and show JFrame in AWT thread and finish when user provides input. By this way caller will be blocked till user provides input so it will work in the same way as with modal dialog.
Solution 3: Another possible solution is to use JDK 1.6.0 code: JDialog d = new JDialog((Window)null, "Title", Dialog.ModalityType.APPLICATION_MODAL); It will work only on JDK 1.6.0. We must use reflection so that code can be compiled with older JDK. Let me know if this solution is acceptable. If there will be no objections I will implement this solution.
Too late for NB5.0, please reevaluate.
Created attachment 30439 [details] Modal dialog test without owner with item at window task bar using JDK 1.6 API
Created attachment 30440 [details] The same as above using reflection ie. it is compilable also by JDK 1.5.0 and JDK 1.4.2
moving opened issues from TM <= 6.1 to TM=Dev
*** Issue 145917 has been marked as a duplicate of this issue. ***
Can we do this for 6.5? It seems that the solution is done, it just needs to be agreed upon and committed.
Since the fix is done, Marek, can you please commit it? I agree the solution is not ideal, but it is better to have it fixed for JDK1.6 only than not to have it fixed at all.
Fixed core-main #9d2c3f31796f JDK 6 API is used so it does not work on JDK 5. Variant 3 is used.
Integrated into 'main-golden', will be available in build *200809231435* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/9d2c3f31796f User: Marek Slama <mslama@netbeans.org> Log: #66359: Set APPLICATION modality type for dialog so that it has item in OS WM task list on Windows on JDK 6
v/c