Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
237 views
in Technique[技术] by (71.8m points)

java - How can I add localization to JFileChooser for a locale that is not supported by default?

The list of supported locales for User Interface Translation does not have all the languages I need to support. How can I add more languages for a JFileChooser?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can change the properties of your JFileChooser like FileChooser.openButtonText

UIManager.put("FileChooser.acceptAllFileFilterText", "Directorios");
UIManager.put("FileChooser.lookInLabelText", "Localiza??o");
UIManager.put("FileChooser.cancelButtonText", "Cancelar");
UIManager.put("FileChooser.cancelButtonToolTipText", "Cancelar");
UIManager.put("FileChooser.openButtonText", "Adicionar");
UIManager.put("FileChooser.openButtonToolTipText", "Adicionar ficheiro(s)");
UIManager.put("FileChooser.filesOfTypeLabelText", "Tipo");
UIManager.put("FileChooser.fileNameLabelText", "Ficheiro(s)");
UIManager.put("FileChooser.listViewButtonToolTipText", "Lista"); 
UIManager.put("FileChooser.listViewButtonAccessibleName", "Lista"); 
UIManager.put("FileChooser.detailsViewButtonToolTipText", "Detalhes");
UIManager.put("FileChooser.detailsViewButtonAccessibleName", "Detalhes");
UIManager.put("FileChooser.upFolderToolTipText", "Um nível acima"); 
UIManager.put("FileChooser.upFolderAccessibleName", "Um nível acima"); 
UIManager.put("FileChooser.homeFolderToolTipText", "Ambiente de Trabalho"); 
UIManager.put("FileChooser.homeFolderAccessibleName", "Ambiente de Trabalho"); UIManager.put("FileChooser.fileNameHeaderText", "Nome"); 
UIManager.put("FileChooser.fileSizeHeaderText", "Tamanho"); 
UIManager.put("FileChooser.fileTypeHeaderText", "Tipo"); 
UIManager.put("FileChooser.fileDateHeaderText", "Data"); 
UIManager.put("FileChooser.fileAttrHeaderText", "Atributos"); 
UIManager.put("FileChooser.openDialogTitleText","Adicionar Fotos");
UIManager.put("FileChooser.readOnly", Boolean.TRUE);

Resources :


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...