How do I display SJIS encoded string in a Jtextfie...
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yan_guillot
Posted On:   Wednesday, March 7, 2001 06:06 AM

How do I display SJIS encoded string in a Jtextfield? 1/ myResourceBundle_ja contains : book_it=Ÿ`ŸPŸbŸgŸOŸX 2/ My main: System.setProperty("user.language","ja"); System.setProperty("file.encoding","SJIS"); String string = null; try{ string = new String(localisation.getTranslation("book_it",Locale.JAPANESE).getBytes(),"SJIS"); }catch (java.io.UnsupportedEncodingException ioe){ioe.printStackTrace(System.out);} javax.swing.JFrame frame = new javax.swing.JFrame(); javax.swing.JTextField textfied = new javax.swing.JTextField(); textfied.setLocale(Locale.JAPAN); java.awt.Font font = new java.awt.Font("M   More>>

How do I display SJIS encoded string in a Jtextfield?
1/ myResourceBundle_ja contains :
book_it=Ÿ`ŸPŸbŸgŸOŸX
2/ My main:
System.setProperty("user.language","ja");
System.setProperty("file.encoding","SJIS");
String string = null;
try{
string = new String(localisation.getTranslation("book_it",Locale.JAPANESE).getBytes(),"SJIS");
}catch (java.io.UnsupportedEncodingException ioe){ioe.printStackTrace(System.out);}
javax.swing.JFrame frame = new javax.swing.JFrame();
javax.swing.JTextField textfied = new javax.swing.JTextField();
textfied.setLocale(Locale.JAPAN);
java.awt.Font font = new java.awt.Font("MS Gothic", java.awt.Font.PLAIN, 36);
textfied.setFont(font);
textfied.setText(string);
frame.getContentPane().setLayout(new java.awt.BorderLayout());
frame.getContentPane().add(textfied);
frame.pack();
frame.setVisible(true);
===> does not work ?! and I don't know why ?

   <<Less
About | Sitemap | Contact