Tuesday 3 September 2013

java swing tutorial : Руссификация, руссификация JFileChooser и не только

Оракл не руссифицировал Java Swing по-человечески, вот самый простой способ локализовать приложение через UIManager - в первую очередь JFileChooser


        UIManager.put("FileChooser.fileNameLabelText", "Имя файла:");
        UIManager.put("FileChooser.lookInLabelText", "Папка:");       
        UIManager.put("FileChooser.filesOfTypeLabelText", "Тип:");       
        UIManager.put("FileChooser.detailsViewActionLabelText", "Детали");
        UIManager.put("FileChooser.refreshActionLabelText", "Обновить");
        UIManager.put("FileChooser.listViewActionLabelText", "Список");       
        UIManager.put("FileChooser.newFolderActionLabelText", "Новая папка");
        UIManager.put("FileChooser.viewMenuLabelText", "Просмотр");       
        UIManager.put("FileChooser.fileDateHeaderText","Детали");               
        UIManager.put("FileChooser.fileDateHeaderText", "Изменен");       
        UIManager.put("FileChooser.fileNameLabelText", "Имя файла");       
        UIManager.put("FileChooser.fileNameHeaderText", "Имя");       
        UIManager.put("FileChooser.fileSizeHeaderText", "Размер");
        UIManager.put("FileChooser.saveDialogTitleText", "Сохранить");
        UIManager.put("FileChooser.saveInLabelText", "Сохранить в:");
        UIManager.put("FileChooser.upFolderToolTipText", "На один уровень вверх");
        UIManager.put("FileChooser.homeFolderToolTipText", "Домой");
        UIManager.put("FileChooser.listViewButtonToolTipText", "Список");
        UIManager.put("FileChooser.newFolderToolTipText", "Создать новую папку");
        UIManager.put("FileChooser.detailsViewButtonToolTipText", "Таблица");
       
        UIManager.put("FileChooser.saveButtonText", "Сохранить");
       
        UIManager.put("FileChooser.cancelButtonText", "Отмена");