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

File Dialog is not I18N in Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.2_06
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      1.Set locale to French
      2.Open a FileDialog
      3.All strings are in English

      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      import java.io.File;
      import java.io.FileInputStream;

      import java.awt.Dimension;
      import java.awt.*;
      import java.util.Locale;

      public class FileDialogTest
      {
        public static void main(String s[])
        {
          load();
          System.exit(0);
        }
       
      // Opens a file
      public static void load() {
        Frame frame = new Frame();
        FileDialog fd = new FileDialog(frame, "Oracle.com", FileDialog.LOAD);
        fd.setLocale(Locale.FRENCH);
        Locale.setDefault(Locale.FRENCH);
        fd.show();
        String filename = fd.getDirectory()+ fd.getFile();
        File f = new File(filename);
        int size = (int)f.length();
        int bytes_read = 0;
        if (filename != null) {
          try {
            FileInputStream fis = new FileInputStream(filename);
            byte[] data = new byte[size];
            
            while (bytes_read < size)
              bytes_read += fis.read(data, bytes_read, size-bytes_read);
              
            
            TextArea ta = new TextArea();
            frame.add(ta);
            ta.setText(new String(data));
            frame.setTitle(fd.getFile());
            frame.addWindowListener
            (new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                   System.exit(0);
                   }
                }
            );
            
            frame.pack();
            frame.show();
          }
          catch (Exception e) {
            System.out.println(e);
          }
        }
      }
       
      }
      ###@###.### 2005-1-27 23:34:42 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yan Yuri Nesterenko
              Reporter:
              mmma Marvin Ma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: