Package javax.swing

Examples of javax.swing.LookAndFeel


    /**
     * Sets the parent of the passed in ActionMap to be the audio action
     * map.
     */
    static void installAudioActionMap(ActionMap map) {
  LookAndFeel laf = UIManager.getLookAndFeel();
        if (laf instanceof BasicLookAndFeel) {
            map.setParent(((BasicLookAndFeel)laf).getAudioActionMap());
        }
    }
View Full Code Here


     *
     * @param c JComponent to play the sound for.
     * @param actionKey Key for the sound.
     */
    static void playSound(JComponent c, Object actionKey) {
        LookAndFeel laf = UIManager.getLookAndFeel();
        if (laf instanceof BasicLookAndFeel) {
            ActionMap map = c.getActionMap();
            if (map != null) {
                Action audioAction = map.get(actionKey);
                if (audioAction != null) {
View Full Code Here

    else
    {
      lafClass = Class.forName(lafClassName);
    }
    // Get the new Look and Feel object.
    final LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
    // If a different LAF to the current one has been requested then
    // change to the requested LAF.
    LookAndFeel curLaf = UIManager.getLookAndFeel();
    s_log.debug(curLaf);
    if (force || curLaf == null || !curLaf.getName().equals(laf.getName()))
    {
      ILookAndFeelController lafCont = getLookAndFeelController(lafClassName);
      lafCont.aboutToBeInstalled(this, laf);

      // Set Look and Feel.  If this is the Substance placeholder, skip it as it is not a real
View Full Code Here

      {
        String className = it.next();
        Class<?> lafClass = Class.forName(className, false, _lafClassLoader);
        try
        {
          LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
          if (laf.isSupportedLookAndFeel())
          {
            LookAndFeelInfo info = new LookAndFeelInfo(laf.getName(), lafClass.getName());
            UIManager.installLookAndFeel(info);
          }
        }
        catch (Throwable th)
        {
View Full Code Here

   */
  public void hasBeenInstalled(LAFRegister lafRegister, LookAndFeel laf)
  {
    final String skinName = _prefs.getSkinName();
    Class<?> skinClass = _lafData.getSkinClassForName(skinName);
    LookAndFeel skinObject;
    try
    {
      skinObject = (LookAndFeel)skinClass.newInstance();
      UIManager.setLookAndFeel(skinObject);
      UIManager.getLookAndFeelDefaults().put("ClassLoader", _cl);
View Full Code Here

    private static int         IMAGE_COUNT             = 0;

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                LookAndFeel laf = new SeaGlassLookAndFeel();
                try {
                    UIManager.setLookAndFeel(laf);
                } catch (UnsupportedLookAndFeelException e1) {
                    e1.printStackTrace();
                }
View Full Code Here

        try {

            // Instantiate Aqua but don't install it.
            Class<?>    lnfClass     = Class.forName(UIManager.getSystemLookAndFeelClassName(), true,
                                                     Thread.currentThread().getContextClassLoader());
            LookAndFeel aqua         = (LookAndFeel) lnfClass.newInstance();
            UIDefaults  aquaDefaults = aqua.getDefaults();

            // Use Aqua for any menu UI classes.
            d.put("MenuBarUI", aquaDefaults.get("MenuBarUI"));
            d.put("MenuUI", aquaDefaults.get("MenuUI"));
        } catch (Exception e) {
View Full Code Here

            return true;
        } else if ("ancestor" == eName && event.getNewValue() != null) {

            // Only update on an ancestor change when getting a valid
            // parent and the LookAndFeel wants this.
            LookAndFeel laf = UIManager.getLookAndFeel();

            return (laf instanceof SynthLookAndFeel && ((SynthLookAndFeel) laf).shouldUpdateStyleOnAncestorChanged());
        }
        /*
         * Note: The following two Sea Glass based overrides should be
View Full Code Here

            icon = getClosedIcon();
        }
       
  if (!tree.isEnabled()) {
      setEnabled(false);
            LookAndFeel laf = UIManager.getLookAndFeel();
            Icon disabledIcon = laf.getDisabledIcon(tree, icon);
            if (disabledIcon != null) icon = disabledIcon;
            setDisabledIcon(icon);
  } else {
      setEnabled(true);
            setIcon(icon);
View Full Code Here

    JLabel label = new JLabel();
    ComponentUI buttonUI = UIManager.getUI(button);
    ComponentUI labelUI = UIManager.getUI(label);
    MultiButtonUI multiButtonUI = new MultiButtonUI();
    MultiLabelUI multiLabelUI = new MultiLabelUI();
    LookAndFeel auxLaf = new SyserrLookAndFeel();

    // without auxiliary look and feels createUIs returns UI fron default
    // look and feel
    assertEquals(buttonUI, MultiLookAndFeel.createUIs(multiButtonUI,
        multiButtonUI.uis, button));
View Full Code Here

TOP

Related Classes of javax.swing.LookAndFeel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.