-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
JWindow and JToolTip How to achieve backdrop transparent ? #705
Comments
Sorry, but I've no idea what you're doing... 😕 Is this even related to FlatLaf? |
What does it look like without FlatLaf? |
When there is no flatlaf, the background can be transparent normally |
Do you have a screenshot? |
Finally, I realized what you mean 😔 : a JWindow with transparent background is not shown transparent on macOS Test case to reproduce: import java.awt.Color;
import javax.swing.*;
import javax.swing.border.LineBorder;
import com.formdev.flatlaf.FlatLightLaf;
public class WindowTest
{
public static void main( String[] args ) {
SwingUtilities.invokeLater( () -> {
FlatLightLaf.setup();
JLabel label = new JLabel( "text" );
label.setBorder( new LineBorder( Color.red ) );
JWindow window = new JWindow();
window.setBackground( new Color( 0, 0, 0, 0 ) );
window.add( label );
window.setBounds( 50, 50, 200, 200 );
window.setVisible( true );
} );
}
} On macOS this shows gray window with drop shadow: On Windows it works and does not show window border or background: The reason seems to be that FlatLaf sets background color for root pane here:
To workaround this issue make the root pane also transparent: _jWindow.getRootPane().setBackground(new Color(0, 0, 0, 0)); Anyway, I'll fix this issue soon... |
…nt color (alpha < 255) did not show the window translucent (issue #705)
fixed in latest |
macOS: JWindow and JToolTip backdrop not transparent
The text was updated successfully, but these errors were encountered: