-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.2_06
-
x86
-
linux
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
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
- duplicates
-
JDK-5092540 Unlocalized strings on Open and Save dialogs
-
- Open
-