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

Trailing character's getting clipped in JLable

    Details

      Description

      Name: dk106046 Date: 06/09/2004

      OPERATING SYSTEM(S):
      RedHat Linux

      FULL JDK VERSION(S):
      java version "1.4.0_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_04-b04)
      Java HotSpot(TM) Client VM (build 1.4.0_04-b04, mixed mode)

      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b06)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b06, mixed mode)

      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b45)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b45, mixed mode)


      On running the swing motifLookandFeel testcase with JDK we see that the trailing last character of text content of JLabel is getting truncated /clipped.
      The truncation is see only on some characters such as "w" or "v" or "y". So we can say the clipping is occurring only on the character which has a right hand side elevations.

      Run the testcase with JDK 1.4.X and JDK 1.5 X.

      import java.util.*;
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;
                                                                                                                                                   
      public class TestCzech {
                                                                                                                                                   
        public static void main(String args[]) {
          String motifClass = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
          //String motifClass = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
          try {
            UIManager.setLookAndFeel(motifClass);
          } catch (ClassNotFoundException e) {
            System.out.println("couldn't find" + motifClass);
          } catch (Exception e2) {
            System.out.println(e2);
          }
                                                                                                                                                   
          JFrame frame = new JFrame("Test Czech");
          JButton jb = new JButton("hav");
          JLabel jl = new JLabel ("monkey");
          JPanel jPanel = new JPanel();
          jPanel.setLayout(new BorderLayout());
          JPanel btnPanel = new JPanel();
          btnPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
          btnPanel.add(jb);
          jPanel.add(btnPanel);
          jPanel.add(btnPanel,"South");
          jPanel.add(jl);
          jPanel.add(jl,"West");
          frame.getContentPane().add(jPanel);
          frame.addWindowListener( new WindowAdapter()
                      {
                              public void windowClosing( WindowEvent e )
                              {
                                      System.exit(0);
                              }
                      } );
          frame.pack();
          frame.setVisible(true);
                                                                                                                                                   
                                                                                                                                                   
        }
      }

      Additional configuration information:
      Default Xwindows setting. No additional setting required.

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svioletsunw Scott Violet (Inactive)
                Reporter:
                dkorbel David Korbel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: