https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
t

Tsung Wu

10/16/2023, 12:04 PM
Hi all! There is a border on SwingPanel when running on Windows. How can I remove it?
k

Kirill Grouchnikov

10/16/2023, 1:27 PM
Screenshot? Code snippet? Something?
t

Tsung Wu

10/16/2023, 1:33 PM
@Kirill Grouchnikov As you can see on the right area, there is a tiny gray border
k

Kirill Grouchnikov

10/16/2023, 1:36 PM
It can be a bunch of things. Maybe there’s a border on one of the swing components set by either the component or the look-and-feel you’re using. Maybe there’s an off-by-one mismatch in the layout, and that calendar widget doesn’t fully fill its parent area. Maybe you have a container whose fill color is lighter gray compared to the darker gray of its content.
t

Tsung Wu

10/16/2023, 1:40 PM
@Kirill Grouchnikov even when I use a empty JPanel there is a border
Calendar is written by myself, there is no any third party widget.
This only happened on Windows, macOS is ok.
@Kirill Grouchnikov here is pure compose content on the right. No border at all.
I can access JPanel(parent of factory()) created by SwingPanel on update callback. But the JPanel parent is null, I can’t get any information of its parent.
k

Kirill Grouchnikov

10/16/2023, 1:49 PM
Make as simple of a reproducer as you can, removing everything but the bare minimum needed to reproduce this, and then post the full code of it. Without seeing the code it’s impossible to tell.
t

Tsung Wu

10/16/2023, 2:15 PM
https://github.com/ionull/SwingPanelBorderBug @Kirill Grouchnikov here is the min example
Screenshot 2023-10-16 at 22.15.46.png
Image from iOS.jpg
mac and win screenshot
Windows 10 macOS Sonoma
This problem does not exist on Linux as well (Ubuntu 22.04)
k

Kirill Grouchnikov

10/17/2023, 1:02 PM
Is it the same display with the same density?
t

Tsung Wu

10/17/2023, 1:04 PM
@Kirill Grouchnikov I will run it with same display if needed, have both systems installed
The Linux is same display with Windows
@Kirill Grouchnikov here is Linux Screenshot with same display as Windows
@Kirill Grouchnikov can you reproduce it on Windows?
@Kirill Grouchnikov I just asked my friend to test it. There is no problem on his Windows 11. It could be a problem that only exists on BootCamp Windows.
2 Views