List of usage examples for javax.swing JComponent setDefaultLocale
public static void setDefaultLocale(Locale l)
From source file:de.dmarcini.submatix.pclogger.gui.ProgramProperetysDialog.java
/** * Konstruiere den Dialog mit den Eingenschaften Project: SubmatixBTForPC Package: de.dmarcini.submatix.pclogger.gui * /*from w w w.j av a 2s .c om*/ * @author Dirk Marciniak (dirk_marciniak@arcor.de) Stand: 18.07.2012 * @param _databaseUtil */ public ProgramProperetysDialog(LogDerbyDatabaseUtil _databaseUtil) { this.lg = SpxPcloggerProgramConfig.LOGGER; this.databaseUtil = _databaseUtil; initDialog(); lg.debug("ProgramProperetysDialog created..."); JComponent.setDefaultLocale(Locale.getDefault()); setLanguageStrings(); databaseDirTextField.setText(SpxPcloggerProgramConfig.databaseDir.getAbsolutePath()); logfileNameTextField.setText(SpxPcloggerProgramConfig.logFile.getAbsolutePath()); exportDirTextField.setText(SpxPcloggerProgramConfig.exportDir.getAbsolutePath()); // Buttons entsprechend setzen switch (SpxPcloggerProgramConfig.unitsProperty) { case ProjectConst.UNITS_DEFAULT: defaultUnitsRadioButton.setSelected(true); lg.debug("units is DEFAULT in config"); break; case ProjectConst.UNITS_METRIC: metricUnitsRadioButton.setSelected(true); lg.debug("units is METRIC in config"); break; case ProjectConst.UNITS_IMPERIAL: imperialUnitsRadioButton.setSelected(true); lg.debug("units is IMPERIAL in config"); break; default: defaultUnitsRadioButton.setSelected(true); } wasChangedParameter = false; lg.debug("ProgramProperetysDialog created..."); }
From source file:net.pandoragames.far.ui.swing.FindAndReplace.java
/** * User preferences./*from w w w . j a va2 s. c o m*/ */ private void configure() { logger.debug("Configuration..."); try { config = new SwingConfig(); configFactory = new FARConfigurationFactory(); configFactory.loadConfig(config); // localizer File localizerProperties = new File( this.getClass().getClassLoader().getResource("fartext.properties").toURI()); Localizer loco = new DefaultLocalizer(localizerProperties, Locale.ENGLISH); JComponent.setDefaultLocale(loco.getLocale()); config.setLocalizer(loco); } catch (Exception x) { logger.error(x.getClass().getName() + ": " + x.getMessage(), x); throw new ConfigurationException(x.getClass().getName() + ": " + x.getMessage()); } // standard component hight JButton testButton = new JButton("TEST"); config.setStandardComponentHight(testButton.getPreferredSize().height); // screen center Rectangle screen = getGraphicsConfiguration().getBounds(); config.setScreenCenter(new Point((screen.width - screen.x) / 2, (screen.height - screen.y) / 2)); }
From source file:org.zaproxy.zap.GuiBootstrap.java
/** * Sets the default {@code Locale} for Swing components. * * @param locale the locale that will be set as default locale for Swing components * @see JComponent#setDefaultLocale(Locale) *///from w ww . jav a 2 s .c o m private static void setDefaultViewLocale(Locale locale) { JComponent.setDefaultLocale(locale); }