RFR: 8216471: GTK LnF: Frame is clipped and does not show JTable,Tooltip and JTree demo in SwingSet2 demo

Abhishek Kumar abhiscxk at openjdk.org
Fri Jul 12 06:57:54 UTC 2024


On Thu, 11 Jul 2024 14:09:43 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> I believe setPreferredSize in the constructor is still needed, right?

Yeah, it is required otherwise the window is very small in size.

> It seems there is a lag when L&F changed from Java to GTK and the frame takes some time (approx 5 sec in my testing) to set its size to greater dimension.

For me it's taking approx 3 sec to set the greater dimension from Java to GTK but it's only for the first time. From next time onwards it takes less time. Infact without the current changes, it is taking approx 2-3 sec to switch it from Java to GTK (Existing implementation).

> when moved back from GTK to Java, the height is less compared to what it started off initially in Java L&F and part of the JInternalFrame frame0 is cut off...Are you seeing the same?

Even I observed the same now and this is due the resizing of frame. After a bit of analysis I found out we are setting the preferred size of panel to (720, 640) but after adding the panel to the frame, the frame.pack() resizes the frame to (720, 698).
When moving back to java from GTK the frame is resized to (720, 640) explicitly, the frame height is set to 640 which is lesser than original height of 698 and that causes the clipping of JInterFrame frame0.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20052#issuecomment-2224944490


More information about the client-libs-dev mailing list