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 228450 - Improve UX allowing mouse click over blank area of Tree elements to select them
Summary: Improve UX allowing mouse click over blank area of Tree elements to select them
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Assignee: Jan Peska
Depends on:
Reported: 2013-04-10 15:50 UTC by brunoborges
Modified: 2016-07-25 16:45 UTC (History)
2 users (show)

See Also:
Exception Reporter:

clicks over tree itens (13.96 KB, image/png)
2013-04-10 15:50 UTC, brunoborges
Trivial patch (1.00 KB, patch)
2013-04-24 02:07 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description brunoborges 2013-04-10 15:50:08 UTC
Created attachment 133431 [details]
clicks over tree itens

For example, when I'm working on the Projects tree view, a selected item is highlighted fully, covering the whole width of the view.

But to select another item in the tree view, it only works when I click on the text of the item, not on the "line" of the item.

On the attached image, I have marked 4 points of click and their behaviour:

(yellow) selects the item "Issue Trackers"
(green) selects the item "Hudson Builders"
(blue) does NOT select the item "Cloud"
(red) does NOT select the item "Servers"
Comment 1 Jaroslav Tulach 2013-04-15 06:16:45 UTC
Unless Standa knows an easy way to achieve this in standard Swing, we'll assume this is standard Swing behavior that we just accept in explorer.
Comment 2 brunoborges 2013-04-15 06:24:06 UTC
So I assume that the status should not be "FIXED", as this is not going to be fixed at all.
Comment 3 brunoborges 2013-04-15 06:29:03 UTC
Accordin to this article, it is possible to achieve the "correct" behaviour:
Comment 4 Stanislav Aubrecht 2013-04-23 10:10:09 UTC
That's how Swing works. Please file a bug against JDK if you want it fixed.
Comment 5 brunoborges 2013-04-23 21:11:40 UTC
Don't see this as Swing bug, but as a poor UX of NetBeans. This might be the default Swing behaviour, but Swing offers a way to improve the user experience, as presented in the referenced article.

Sorry if saying that "correct behaviour" led to a misunderstanding of this issue.

On a sidenote, I doubt Swing team will change the default behaviour. 

But NetBeans could definitely improve its UX.
Comment 6 _ tboudreau 2013-04-24 02:07:47 UTC
Created attachment 133733 [details]
Trivial patch

Claiming "this is standard Swing behavior" isn't really an excuse - there are already plenty of places where explorer trees customize that behavior (right click outside the tree, continuation tooltips, double-click behavior, the timer that makes all single clicks not result in a rename operation).

In fact, the attached patch adds its behavior to existing code which makes double-clicking already behave the way Bruno is suggesting - this just adds it for single clicks.
Comment 7 Stanislav Aubrecht 2013-04-24 09:03:39 UTC
The patch might be trivial but it doesn't address all full-row select issues - it doesn't initiate dnd when clicked outside the cell area, doesn't expand on double-click, doesn't show popup menu etc.
It has also unwanted side-effect that clicking expansion icon selects the tree row.