Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8239592

Simple JOptionPane window needs a pixel more in width

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 Pro, 64 Bit x64, Intel Core i5-6200U CPU @ 2.30GHz 2.40 GHz
      java version "1.8.0_241"
      Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Simple JOptionPane window needs a pixel more in width.

      ! Attention !

      Dear Sir or Madam of Java,
      I am actually a software tester and am currently refreshing my Java skills. Here I became aware of this point during a task during a tutorial. And I wanted to report this situation as a bug if it is a bug.
      Thank you for your comprehension.

      REGRESSION : Last worked in version 8u241

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      STEP-1: Code or create a simple showInputDialog/showMessageDialog.
      STEP-2: Display the window.
      STEP-3: Check the right side, the right edge of the shown simple window.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      STEP-1: A simple showInputDialog/showMessageDialog coded.
      STEP-1: A simple showInputDialog/showMessageDialog is displayed.
      STEP-3: MAY the right edge of the shown simple window is identical with the right edge of the titel-header bar.
      ACTUAL -
      STEP-1: A simple showInputDialog/showMessageDialog coded. - OK
      STEP-1: A simple showInputDialog/showMessageDialog is displayed. - OK
      STEP-3: The right edge of the shown simple window is NOT identical by one pixel with the right edge of the titel-header bar. - nOK

      ---------- BEGIN SOURCE ----------
      /*
      Einlesen von Benutzereingaben als Konsolenanwendung
      */

      import javax.swing.JOptionPane;

      public class Kreisberechnung4JOptionPane {

      public static void main(String[] args) {

      double radius, umfang, flaeche;
      String einheit, eingabe;

      eingabe = JOptionPane.showInputDialog("Gebe den Radius ein:_");
      radius = Double.parseDouble(eingabe);

      eingabe = JOptionPane.showInputDialog("Gebe die Einheit ein:_");
      einheit = eingabe;

      umfang = 2.0 * 3 * radius;
      flaeche = 3 * radius * radius;

      JOptionPane.showMessageDialog(null, "Umfang: " + umfang + " " + einheit
      + "\nFlaeche: " + flaeche + " " + einheit + '\u00b2');

      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        1. expectedVSactual.png
          expectedVSactual.png
          282 kB
        2. Kreisberechnung4JOptionPane.java
          0.6 kB
        3. myoutput.png
          myoutput.png
          20 kB
        4. myoutput1.png
          myoutput1.png
          58 kB

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: