-
We have an old customer coming back to us. Almost 20 years ago, we delivered a project which included Swing screens using a set of custom components. Is there a migration guide that describes things that need to be done differently in order to work with WindowBuilder compared to the ancient Pro version? Issue DescriptionIn WindowBuilder Pro, they have The screen is 90 lines high, so 1530 pixels (component/line height is fixed at 17 pixels). The same screen in the current environment (Windows Server 2019 x64, OpenJDK 17.0.6, Eclipse 2023-03 (4.27.0) and WindowBuilder 1.12.0) is not shown completely: Same size and resolution. If they reduce the vertical resolution to 1024, then the visibility is commensurately reduced: Note that they claim they already investigated the free WindowBuilder over a decade ago, and saw the same problem at that time, which is mainly why they did not switch. The x86->x64 push is now forcing their hand. If there is no migration guide, and none of this rings a bell as a known issue, I can attach the source of the screen in question along with our component jar for further investigation. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 8 replies
-
Yes, please add all the stuff, as small as possible, that shows us the situation. |
Beta Was this translation helpful? Give feedback.
-
I agree, a small reproducer is greatly appreciated. Maybe as a general question: Does the problem also show up in the preview or is it only the design page, where the screen is partially shown? |
Beta Was this translation helpful? Give feedback.
-
Here is the panel from the screenshots, plus the jar with the components. The preview doesn't seem to include a scrollbar so does not reach the affected area: |
Beta Was this translation helpful? Give feedback.
-
@ptziegler @wimjongman Have either of you had any time to have a look at this? |
Beta Was this translation helpful? Give feedback.
-
My apologies, I completely missed your response with the example project. Having a closer look, this issue seems to be oddly similar to #384 I have the suspicion that this problem is a limitation on how we calculate the preview. To keep it simple, we first create an instance of the class and then we create a screenshot from the area, where the object is shown on the screen. Looking at your screenshots, I think something similar happens here. The composite is only visible up until the "Propositions" area, which is roughly the area where those black bars appear in the design page. If this is indeed the problem, then I don't have an immediate solution on how to deal with this unmapped area... I sadly don't have such an old WindowBuilder version at hand, to see whether it's using a different mechanism than what we use today. Out of curiosity, does the problem also show up on Windows Server 2019 + WindowBuilder 6.4.1? What happens when you use a higher screen resolution? |
Beta Was this translation helpful? Give feedback.
-
That should work, I suppose... You can get the screen resolution via Display.getBounds() and the composite size via Control.getBounds(). From this, you can split up the composite into segments and my moving it around, assure that each segment is inside the visible area, before taking the screenshot. The tricky part is going to forward this information to the native method calls, which communicate directly with the Windows/GDK/Aqua... However, there are already quite a lot of tasks on my todo-list, so I'm afraid I won't be able to work on this anytime soon. If you're willing to give it a shot, the OSSupport class would be a good starting point. And if there are any open questions, I'm more than willing to help you out as best as I can. Until then, working on a screen with a higher resolution seems like the most promising workaround. |
Beta Was this translation helpful? Give feedback.
-
I appreciate the offer, but I don't think that's necessary. From what I can tell, the underlying problem is caused by the JDK itself. If you try to show a Swing component that is larger than the screen, it will instead maximize. I.e. the new width and height are smaller than or equal to the screen size. I've tried a couple of things and so far, the results look promising. I'll try to commit this change some time today. Could you try out one of next weeks nightly build and give feedback whether this also works on your side? |
Beta Was this translation helpful? Give feedback.
I appreciate the offer, but I don't think that's necessary. From what I can tell, the underlying problem is caused by the JDK itself. If you try to show a Swing component that is larger than the screen, it will instead maximize. I.e. the new width and height are smaller than or equal to the screen size.
I've tried a couple of things and so far, the results look promising. I'll try to commit this change some time today. Could you try out one of next weeks nightly build and give feedback whether this also works on …