0

I created a simple dialog box using JOptionPane but when I run it with Java 8 the dialog box is extremely small, however when running with Java 18 the size is reasonably normal. Why is there a differance between those versions and how to fix the program so it would run in Java 8 similar to what I got in Java 18.

Output of Java 18: output of Java 18

Output of Java 8: output of Java 8

I tried to change the text size with method UIManager.put("OptionPane.messageFont",...) but that changes only the text and didn't affect the size of other components (buttons, icons, etc.). I can't find the right command to simply "enlarge" the dialog box. Also I read through the API of JOptionPane but didn't find a reason for that diffarence.

  • 2
    Is this all components or just JOptionPane. Looks to me like the resolution of your monitor has changed or the scaling factor is different. If it is a scaling issue check out point 1/2 of: https://stackoverflow.com/a/65742492/131872 – camickr Nov 01 '22 at 15:27
  • This is just a simple JOptionPane (the entire code can be seen in the images). I run the same code using both compilers without changing any other settings or resolution. Also I tried your fix, but it didn't change the output. – Matanya Malca Nov 04 '22 at 09:06

0 Answers0