I have a problem with displaying characters with diacritic like á, í, č, etc. I've set .properties file to UTF-8 with ISO 8599-1 but when I run following code I dont have wanted result.
Main class:
@Override
    public void start(Stage primaryStage) throws Exception{
        FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setResources(ResourceBundle.getBundle("bundles.language_sk", new Locale("sk", "SK")));
            Parent root = fxmlLoader.load(getClass().getResource("/view/loginFrame.fxml"));
            primaryStage.setTitle("Login");
            Scene scene = new Scene(root, 563, 580);
            primaryStage.setScene(scene);
            primaryStage.setResizable(false);
            primaryStage.show();
        }
Login Frame controller class:
@Override
    public void initialize(URL location, ResourceBundle resources) {
        ResourceBundle bundle = ResourceBundle
                .getBundle("bundles.language_sk", new Locale("sk", "SK"));
        setLoginBtnText(bundle);
    }
    public void setLoginBtnText(ResourceBundle bundle){
            loginBtn.setText(bundle.getString("loginButton"));
    }
language_sk.properties file:
#LOGIN FRAME
.
.
loginButton=Prihlásiť
.
.
Result:
So as you can see, I've tried to set text of Login Button using .properties file but characters are messed up.
Although when I use this code in setLoginBtnText method:
 public void setLoginBtnText(ResourceBundle bundle){
        String val = bundle.getString("loginButton");
        try {
            loginBtn.setText(new String(val.getBytes("ISO-8859-1"), "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
then text on button is perfectly fine. How can I set some global encoding settings for my whole project so I dont have to specify encoding at each one component in each class? Thanks.

 
     
     
    