Example usage for javax.swing JFrame getLocale

List of usage examples for javax.swing JFrame getLocale

Introduction

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

Prototype

public Locale getLocale() 

Source Link

Document

Gets the Locale object that is associated with this window, if the locale has been set.

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);//from  w w w . jav a 2s . 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.");
    }
    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);//from   w w w  .  j ava2 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   w ww  . j a va 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.");
    }
    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);/*from ww w  . j  a  v  a 2 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.");
    }
    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;
}