“Comparison method violates its general contract!” – TimSort and GridLayout

It seems to me like you’ve hit a bug in the JDK since the error seems to come from Swing classes. Options: Define the property java.util.Arrays.useLegacyMergeSort as true. Either using in your code the line System.setProperty(“java.util.Arrays.useLegacyMergeSort”, “true”); before any Swing code. As the first line in the main method should work. Or adding -Djava.util.Arrays.useLegacyMergeSort=true to … Read more

Make a div span two rows in a grid

You have fixed heights on your child elements (.block). Based on that information, we can extrapolate the height of the container (#wrapper). By knowing the height of the container, your layout can be achieved using CSS Flexbox with flex-direction: column and flex-wrap: wrap. A fixed height on the container serves as a breakpoint, telling flex … Read more