Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow / Incomplete rendering of TableHeader tooltips in Flatlaf 3.1.1 (Windows 11) #672

Closed
schliepRon opened this issue Apr 28, 2023 · 6 comments
Labels
unreproducible Unable to reproduce
Milestone

Comments

@schliepRon
Copy link

schliepRon commented Apr 28, 2023

When moving the cursor on a TableHeader the tooltip rendering appears to be slower than before on windows 11.

The borders are rendered first, without the content, the content follows slightly later.

Screenshots:
image

@DevCharly
Copy link
Collaborator

Hmm, never seen this. 😕

When moving the cursor on a TableHeader ...

Does it work normal on other components?

Can you reproduce it with following test app?

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.formdev.flatlaf.FlatLightLaf;

public class TooltipTest {
    public static void main( String[] args ) {
        SwingUtilities.invokeLater( () -> {
            FlatLightLaf.setup();

            JButton button = new JButton( "hover to show tooltip" );
            button.setToolTipText( "Hello" );

            JPanel panel = new JPanel();
            panel.add( button );

            JFrame frame = new JFrame( "TooltipTest" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            frame.setBounds( 50, 50, 400, 200 );
            frame.getContentPane().add( panel );
            frame.setVisible( true );
        } );
    }
}

@DevCharly
Copy link
Collaborator

@schliepRon have you tried the above test app?

Anybody else seen this issue?

@schliepRon
Copy link
Author

@DevCharly I couldn`t reproduce it that way.

Also seems to be client specific. Not all my colleagues got that problem.
But I hadn`t much time to really analyze the problem.

I`ll try to analyze it asap.

@DevCharly DevCharly added the unreproducible Unable to reproduce label Jan 8, 2024
@mellmann
Copy link

I am observing this problem in my project. I modified the example from above by @DevCharly.

In this example, the location and the content of the tooltip are updated continuously as the mouse is moved over the JPanel (which is a functionality offered by the JComponent).

Without FlatLightLaf.setup();, the tooltip is updated seemlessly, but with Flatlaf there is a considerable delay in redrawing and flickering as reported by @schliepRon.

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.formdev.flatlaf.FlatLightLaf;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.MouseEvent;

public class TooltipTest {
    public static void main( String[] args ) {
        SwingUtilities.invokeLater( () -> {
            FlatLightLaf.setup();

            JPanel panel = new JPanel() {
                @Override
                public String getToolTipText(MouseEvent e) {
                    return String.format("%d;%d", e.getX(), e.getY());
                }
                @Override
                public Point getToolTipLocation(MouseEvent e)
                {
                  Point p = e.getPoint();
                  p.y += 15;
                  return p;
                }
            };
            
            panel.setToolTipText( "" );

            JFrame frame = new JFrame( "TooltipTest" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            frame.setBounds( 50, 50, 400, 200 );
            frame.getContentPane().add( panel );
            frame.setVisible( true );
        } );
    }
}

@DevCharly
Copy link
Collaborator

@mellmann thanks for the test case.

There is an open issue here: #832

DevCharly added a commit that referenced this issue May 22, 2024
@DevCharly
Copy link
Collaborator

Fixed in latest 3.5-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 3.5 milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unreproducible Unable to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants