本文整理汇总了Java中java.util.MissingResourceException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java MissingResourceException.printStackTrace方法的具体用法?Java MissingResourceException.printStackTrace怎么用?Java MissingResourceException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.MissingResourceException
的用法示例。
在下文中一共展示了MissingResourceException.printStackTrace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findResetToDefaultButton
import java.util.MissingResourceException; //导入方法依赖的package包/类
private AbstractButton findResetToDefaultButton(JDialog jd) {
String txt = null;
try {
txt = NbBundle.getMessage(PropertyDialogManager.class, "CTL_Default");
} catch (MissingResourceException mre) {
mre.printStackTrace();
fail("Bundle key CTL_DEFAULT missing from org.openide.explorer.propertysheet.Bundle.properties");
}
return findButton(jd.getContentPane(), txt);
}
示例2: getDisplayName
import java.util.MissingResourceException; //导入方法依赖的package包/类
public String getDisplayName(Object containerType, String containerCtx) {
try {
return bundle.getString(containerCtx);
} catch (MissingResourceException mre) {
mre.printStackTrace();
return containerCtx;
}
}
示例3: getDisplayName
import java.util.MissingResourceException; //导入方法依赖的package包/类
public String getDisplayName(String actionName, String containerCtx) {
try {
return bundle.getString(actionName);
} catch (MissingResourceException mre) {
mre.printStackTrace();
return actionName;
}
}
示例4: main
import java.util.MissingResourceException; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
int errors = 0;
for (String loctag : args) {
Locale locale = Locale.forLanguageTag(loctag);
if (locale.equals(Locale.ROOT)) {
continue;
}
ResourceBundle rb = ResourceBundle.getBundle("jdk.test.resources.MyResources",
locale);
String tag = locale.toLanguageTag(); // normalized
String value = rb.getString("key");
System.out.println(rb.getBaseBundleName() + ": locale = " + tag + ", value = " + value);
if (!value.startsWith(tag + ':')) {
System.out.println("ERROR: " + value + " expected: " + tag);
errors++;
}
// inaccessible bundles
try {
ResourceBundle.getBundle("jdk.test.internal.resources.Foo", locale);
System.out.println("ERROR: jdk.test.internal.resources.Foo should not be accessible");
errors++;
} catch (MissingResourceException e) {
e.printStackTrace();
Throwable cause = e.getCause();
System.out.println("Expected: " +
(cause != null ? cause.getMessage() : e.getMessage()));
}
}
if (errors > 0) {
throw new RuntimeException(errors + " errors");
}
}
示例5: getString
import java.util.MissingResourceException; //导入方法依赖的package包/类
public static String getString(String key) {
String value = null;
try {
value = getResourceBundle().getString(key);
} catch (MissingResourceException e) {
e.printStackTrace();
System.err.println("java.util.MissingResourceException: Couldn't find value for: " + key);
}
if(value == null) {
value = "Could not find resource: " + key + " ";
}
return value;
}
示例6: LabeledTextFieldDialog
import java.util.MissingResourceException; //导入方法依赖的package包/类
/** Creates new form LabeledTextFieldDialog */
public LabeledTextFieldDialog(String notes)
{
String title = NbBundle.getMessage (LabeledTextFieldDialog.class, "RecreateTableRenameTable"); // NOI18N
String lab = NbBundle.getMessage (LabeledTextFieldDialog.class, "RecreateTableNewName"); // NOI18N
original_notes = notes;
initComponents();
try
{
Mnemonics.setLocalizedText(titleLabel, lab);
titleLabel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (LabeledTextFieldDialog.class, "ACS_RecreateTableNewNameA11yDesc")); // NOI18N
Mnemonics.setLocalizedText(descLabel, NbBundle.getMessage (LabeledTextFieldDialog.class, "RecreateTableRenameNotes")); // NOI18N
descLabel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (LabeledTextFieldDialog.class, "ACS_RecreateTableRenameNotesA11yDesc")); // NOI18N
Mnemonics.setLocalizedText(editButton, NbBundle.getMessage (LabeledTextFieldDialog.class, "EditCommand")); // NOI18N
editButton.setToolTipText(NbBundle.getMessage (LabeledTextFieldDialog.class, "ACS_EditCommandA11yDesc")); // NOI18N
updateState();
ActionListener listener = new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
result = event.getSource() == DialogDescriptor.OK_OPTION;
}
};
getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (LabeledTextFieldDialog.class, "ACS_RecreateTableDialogA11yDesc")); // NOI18N
DialogDescriptor descriptor = new DialogDescriptor(this, title, true, listener);
dialog = DialogDisplayer.getDefault().createDialog(descriptor);
dialog.setResizable(true);
}
catch (MissingResourceException e)
{
e.printStackTrace();
}
}
示例7: resolveVoice
import java.util.MissingResourceException; //导入方法依赖的package包/类
/**
* Attempt to resolve the voice that most suits the conditions and the user's preferences.
*
* @param language the {@link Locale} language
* @param region the {@link Locale} region
* @param conditions the {@link SelfAwareConditions}
* @param params the {@link SelfAwareParameters}
* @return one of {@link #SUCCESS} or {@link #ERROR}
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private int resolveVoice(@NonNull final String language, @NonNull final String region,
@NonNull final SelfAwareConditions conditions, @NonNull final SelfAwareParameters params,
@Nullable final SaiyVoice currentVoice) {
if (DEBUG) {
MyLog.i(CLS_NAME, "resolveVoice");
}
final Pair<SaiyVoice, Locale> voicePair = new TTSVoice(language, region, conditions, params,
currentVoice).buildVoice();
if (voicePair.first != null) {
if (DEBUG) {
MyLog.i(CLS_NAME, "resolveVoice: Setting Voice: " + voicePair.first.toString());
MyLog.i(CLS_NAME, "resolveVoice: Setting Voice loc: " + voicePair.first.getLocale());
try {
MyLog.i(CLS_NAME, "resolveVoice: Setting Voice: isLanguageAvailable: "
+ resolveSuccess(isLanguageAvailable(new Locale(voicePair.first.getLocale().getLanguage(),
voicePair.first.getLocale().getCountry()))));
} catch (final MissingResourceException e) {
MyLog.w(CLS_NAME, "MissingResourceException: isLanguageAvailable failed");
e.printStackTrace();
}
}
return super.setVoice(voicePair.first);
} else {
if (voicePair.second != null) {
if (DEBUG) {
MyLog.i(CLS_NAME, "resolveVoice: Setting Locale deprecated");
}
return setVoiceDeprecated(voicePair.second.getLanguage(), voicePair.second.getCountry());
} else {
if (DEBUG) {
MyLog.w(CLS_NAME, "resolveVoice: voicePair.second null: falling back");
}
return resolveSuccess(super.setLanguage(new Locale(language, region)));
}
}
}