1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
public class ChangeLang extends javax.swing.JFrame {
public static ResourceBundle resourse;
public ChangeLang() {
try {
resourse = ResourceBundle.getBundle("Language",Locale.getDefault());
} catch (MissingResourceException mre) {
mre.printStackTrace();
}
initComponents();
}
private void initComponents() {
label = new javax.swing.JLabel();
button = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
label.setText(resourse.getString("lbl")); //---------------------Nom Label
button.setText("Change");
button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonActionPerformed(evt);
}
});
}
private void buttonActionPerformed(java.awt.event.ActionEvent evt) {
resourse=ResourceBundle.getBundle("Language",Locale.ENGLISH );
//Locale.setDefault(Locale.ENGLISH);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ChangeLang().setVisible(true);
}
});
}
private javax.swing.JButton button;
private javax.swing.JLabel label;
}
//Language_en.proprietes
lbl=name
//Language.proprietes
lbl=nom |
Partager