Example usage for javax.swing JFrame setLocale

List of usage examples for javax.swing JFrame setLocale

Introduction

In this page you can find the example usage for javax.swing JFrame setLocale.

Prototype

public void setLocale(Locale l) 

Source Link

Document

Sets the locale of this component.

Usage

From source file:at.gv.egiz.bku.local.stal.LocalIdentityLinkSTALFactory.java

@Override
public STAL createSTAL() {
    final LocalBKUWorker stal;
    //http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
    // use undecorated JFrame instead of JWindow,
    // which creates an invisible owning frame and therefore cannot getFocusInWindow()
    JFrame dialog = new JFrame("Brgerkarte");
    log.debug("AlwaysOnTop supported: {}.", dialog.isAlwaysOnTopSupported());
    // [#439] make mocca dialog alwaysOnTop
    dialog.setAlwaysOnTop(true);//w  w w.j av a 2s.  co  m
    dialog.setIconImages(BKUIcons.icons);
    //       dialog.setUndecorated(true);
    //       dialog.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

    if (locale != null) {
        dialog.setLocale(locale);
    }
    LocalHelpListener helpListener = null;
    if (helpURL != null) {
        helpListener = new LocalHelpListener(helpURL, locale);
    } else {
        log.warn("No HELP URL configured, help system disabled.");
    }
    IdentityLinkGUIFacade gui = new IdentityLinkGUI(dialog.getContentPane(), dialog.getLocale(), null,
            new ResourceFontLoader(), helpListener);
    BKUGUIFacade proxy = (BKUGUIFacade) GUIProxy.newInstance(gui, dialog,
            new Class[] { IdentityLinkGUIFacade.class });
    stal = new LocalBKUWorker(proxy, dialog);
    dialog.setPreferredSize(PREFERRED_SIZE);
    dialog.pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = dialog.getSize();
    if (frameSize.height > screenSize.height) {
        frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
        frameSize.width = screenSize.width;
    }
    dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    return stal;
}

From source file:at.gv.egiz.bku.local.stal.LocalGetCertificateSTALFactory.java

@Override
public STAL createSTAL() {
    final LocalBKUWorker stal;
    //http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
    // use undecorated JFrame instead of JWindow,
    // which creates an invisible owning frame and therefore cannot getFocusInWindow()
    JFrame dialog = new JFrame("Brgerkarte");
    log.debug("AlwaysOnTop supported: {}.", dialog.isAlwaysOnTopSupported());
    // [#439] make mocca dialog alwaysOnTop
    dialog.setAlwaysOnTop(true);//w ww  .ja  v  a2  s  .  c o  m
    dialog.setIconImages(BKUIcons.icons);
    //       dialog.setUndecorated(true);
    //       dialog.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

    if (locale != null) {
        dialog.setLocale(locale);
    }
    LocalHelpListener helpListener = null;
    if (helpURL != null) {
        helpListener = new LocalHelpListener(helpURL, locale);
    } else {
        log.warn("No HELP URL configured, help system disabled.");
    }
    GetCertificateGUIFacade gui = new GetCertificateGUI(dialog.getContentPane(), dialog.getLocale(), null,
            new ResourceFontLoader(), helpListener);
    BKUGUIFacade proxy = (BKUGUIFacade) GUIProxy.newInstance(gui, dialog,
            new Class[] { GetCertificateGUIFacade.class, });
    stal = new LocalBKUWorker(proxy, dialog);
    dialog.setPreferredSize(PREFERRED_SIZE);
    dialog.pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = dialog.getSize();
    if (frameSize.height > screenSize.height) {
        frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
        frameSize.width = screenSize.width;
    }
    dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);

    return stal;
}

From source file:at.gv.egiz.bku.local.stal.LocalGetHardwareInfoSTALFactory.java

@Override
public STAL createSTAL() {
    final LocalBKUWorker stal;
    //http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
    // use undecorated JFrame instead of JWindow,
    // which creates an invisible owning frame and therefore cannot getFocusInWindow()
    JFrame dialog = new JFrame("Brgerkarte");
    log.debug("AlwaysOnTop supported: {}.", dialog.isAlwaysOnTopSupported());
    // [#439] make mocca dialog alwaysOnTop
    dialog.setAlwaysOnTop(true);//from www.  j av  a  2 s  .  c  om
    dialog.setIconImages(BKUIcons.icons);
    //       dialog.setUndecorated(true);
    //       dialog.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

    if (locale != null) {
        dialog.setLocale(locale);
    }
    LocalHelpListener helpListener = null;
    if (helpURL != null) {
        helpListener = new LocalHelpListener(helpURL, locale);
    } else {
        log.warn("No HELP URL configured, help system disabled.");
    }
    GetHardwareInfoGUIFacade gui = new GetHardwareInfoGUI(dialog.getContentPane(), dialog.getLocale(), null,
            new ResourceFontLoader(), helpListener);
    BKUGUIFacade proxy = (BKUGUIFacade) GUIProxy.newInstance(gui, dialog,
            new Class[] { GetHardwareInfoGUIFacade.class, });
    stal = new LocalBKUWorker(proxy, dialog);
    dialog.setPreferredSize(PREFERRED_SIZE);
    dialog.pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = dialog.getSize();
    if (frameSize.height > screenSize.height) {
        frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
        frameSize.width = screenSize.width;
    }
    dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);

    return stal;
}

From source file:at.gv.egiz.bku.local.stal.LocalSTALFactory.java

@Override
public STAL createSTAL() {

    final LocalBKUWorker stal;
    //http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
    // use undecorated JFrame instead of JWindow,
    // which creates an invisible owning frame and therefore cannot getFocusInWindow()
    JFrame dialog = new JFrame("Brgerkarte");
    log.debug("AlwaysOnTop supported: {}.", dialog.isAlwaysOnTopSupported());
    // [#439] make mocca dialog alwaysOnTop
    dialog.setAlwaysOnTop(true);//w ww  .jav a  2s  .  c  o  m
    dialog.setIconImages(BKUIcons.icons);
    //    dialog.setUndecorated(true);
    //    dialog.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

    if (locale != null) {
        dialog.setLocale(locale);
    }
    LocalHelpListener helpListener = null;
    if (helpURL != null) {
        helpListener = new LocalHelpListener(helpURL, locale);
    } else {
        log.warn("No HELP URL configured, help system disabled.");
    }
    PINManagementGUIFacade gui = new PINManagementGUI(dialog.getContentPane(), dialog.getLocale(), null,
            new ResourceFontLoader(), helpListener);
    BKUGUIFacade proxy = (BKUGUIFacade) GUIProxy.newInstance(gui, dialog,
            new Class[] { PINManagementGUIFacade.class });
    SMCCHelper.setUseSWCard(configurationFacade.getUseSWCard());
    stal = new LocalBKUWorker(proxy, dialog);
    dialog.setPreferredSize(PREFERRED_SIZE);
    dialog.pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = dialog.getSize();
    if (frameSize.height > screenSize.height) {
        frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
        frameSize.width = screenSize.width;
    }
    dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    return stal;
}