Skip to content

Search/Usages result preview window has an extreme mouse wheel property (>=4 movements total?) #9145

Open

Description

@istinnstudio

Apache NetBeans version

Apache NetBeans 28

What happened

Search or Usages results preview windows has its own hardcoded value for mouse wheel up and down movement and is extreme, One mouse wheel movement and it jumps to a relative position (about total lines/ 4) and it is not predictable. This should not happen, it should at least inherit the main editor behavior.

Language / Project Type / NetBeans Component

No response

How to reproduce

Just do a Find/Search or Find Usages and select a result, then in preview window, use mouse wheel up/down

Did this work correctly in an earlier version?

Apache NetBeans 28

Operating System

windows 11

JDK

25

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bug
    needs:triage
    on Jan 17, 2026
  2. added
    UI
    on Jan 21, 2026
  3. mbien commented on Jan 21, 2026

    @mbien
    Member

    can reproduce on linux too. The refactoring preview (diff) does work fine but the non-diff preview jumps a bit much on scroll.

    the view is used by bookmarks/search/find usages windows.

  4. neilcsmith-net commented on Jan 21, 2026

    @neilcsmith-net
    Member

    can reproduce on linux too.

    Curious, I can't. Works fine for me. I wonder what the relevant difference is here.

  5. mbien commented on Jan 21, 2026

    @mbien
    Member

    @neilcsmith-net can you try to make the window larger until it covers most of the screen in height?

    the scroll amount seems to be related to the viewport size in my case.

    hypothesis: the split view scrolls instead of the editor?

  6. neilcsmith-net commented on Jan 21, 2026

    @neilcsmith-net
    Member

    OK @mbien can replicate that - scroll amount is window height related - standard size is fine, maximised is not.

    @istinnstudio is that the same behaviour you see though?

  7. istinnstudio commented on Jan 21, 2026

    @istinnstudio
    Author

    can you try to make the window larger until it covers most of the screen in height?

    Maximizing the preview window (search + usages) does not change anything (extreme movement remains the same), I have also noticed that the preview window in "usages" does include the line numbering and code folding graphics elements plus the local search (ctrl+F) works in preview, but in "search" it does not, it looks more minimal.

  8. mbien commented on Feb 6, 2026

    @mbien
    Member

    the main editor component is based on QuietEditorPane, while the previews are JEditorPanes:

    JEditorPane pane = new JEditorPane();
    EditorKit editorKit = MimeLookup.getLookup(mimeType).lookup(EditorKit.class);
    pane.setEditorKit(editorKit);

    NBEditorUI calls:

    @Override
    public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
    return component.getScrollableUnitIncrement(visibleRect, orientation, direction);
    }

    which is has a custom impl for the QuietEditorPane:

    public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
    switch (orientation) {
    case SwingConstants.VERTICAL:
    return fontHeight;
    case SwingConstants.HORIZONTAL:
    return charWidth;
    default:
    throw new IllegalArgumentException("Invalid orientation: " +orientation);
    }
    }

    but would simply return height/10 for the JEditorPane

  9. removed
    needs:triage
    on Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EditorUIkind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions