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 226397 - Scrollbar in TopComponent starts drag mode
Summary: Scrollbar in TopComponent starts drag mode
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.2.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-20 13:24 UTC by zeljko_p
Modified: 2013-02-23 04:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zeljko_p 2013-02-20 13:24:36 UTC
When you implement an own TabbedComponentFactory and uses JTabbedPaneAdapter the same problem arises as it is described in bug #199311 ("when I try to use the mouse to drag the scrollbar of any TC - editor, explorer-type, Bugzilla, profiler snapshot - which is docked normally (editor mode or not), the scrollbar moves briefly but then stops; the cursor changes to the "drag" icon (arrow plus box); and a red drag outline appears around the window, all as if I had initiated a drag on the title bar").
I have traced it to JTabbedPaneAdapter.tabbedImpl.getTabsArea (). It returns the bounds rectangle of the entire JTabbedPane, not just the headers part.
In my hack, I changed getTabsArea () to the following:

public Rectangle getTabsArea() {
Rectangle r = getBounds();
r.height = 0;
if ( getTabCount() > 0 ) {
TabbedPaneUI ui = getUI();
for ( int i = 0; i < getTabCount(); i++ ) {
r = r.createUnion(getUI().getTabBounds(JTabbedPaneAdapter.this, i)).getBounds();
}
}
return r;
}

Maybe not the best solution, but ...

Best regards,
//Zeljko
Comment 1 Stanislav Aubrecht 2013-02-22 09:34:26 UTC
core-main b9ede790ed48

thanks for the patch!
Comment 2 Quality Engineering 2013-02-23 04:09:31 UTC
Integrated into 'main-golden', will be available in build *201302222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b9ede790ed48
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #226397 - calculate tabs area properly