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

JEditorPane is not fully internationalized for line wrapping.

    XMLWordPrintable

Details

    • rc1
    • x86, sparc
    • linux, solaris_2.6, solaris_7, solaris_8, windows_nt
    • Verified

    Backports

      Description


        JEditorPane is not fully internationalized for line wrapping.
        Japanese text is displayed with wrong line breaks on JEditorPane.
        See the attached snapshot i18n-false.gif.

        To reproduce, the following code is compiled and executed.
        If you don't have any sample HTML file, use the attached Japanese
        HTML file.

        % javac JEditorPaneTest.java
        % java JEditorPaneTest file:<html file path>

        ------------------------------------------------------------------------
        // JEditorPaneTest.java

        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        import javax.swing.text.*;
        import javax.swing.event.*;
        import java.io.*;
        import java.util.*;
        import java.net.URL;

        public class JEditorPaneTest extends JFrame {

            JEditorPane testEditorPane;

            public JEditorPaneTest(String url) {
                super(url);
                try {
                testEditorPane = new JEditorPane(url);
                testEditorPane.setEditable(false);
                } catch (Exception e) {
                    e.printStackTrace();
                }

                JScrollPane testScrollPane = new JScrollPane(testEditorPane);
                testScrollPane.setVerticalScrollBarPolicy
                    (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                getContentPane().add(testScrollPane);
            }

            public static void main(String args[]) {
                if (args.length != 1) {
                    System.out.println("Usage: java JEditorPaneTest URL");
                    System.exit(0);
                }
                JEditorPaneTest test = new JEditorPaneTest(args[0]);
                WindowListener w = new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {System.exit(0); }
                };
                test.addWindowListener(w);
                test.setSize(300, 500);
                test.setVisible(true);
            }
        }
        -------------- End of code.

        Attachments

          Issue Links

            Activity

              People

                svioletsunw Scott Violet (Inactive)
                duke J. Duke
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: