Package javax.swing

Examples of javax.swing.LookAndFeel


 
  private static boolean isMac = System.getProperty("os.name").startsWith("Mac");
 
  private static void getXPlatformLook(JFileChooser fc) {
    if (isMac) {
      LookAndFeel lnf = UIManager.getLookAndFeel();
      // JFileChooser on Mac OS X with the native L&F doesn't work well.
      // If the native L&F of Mac is selected, disable it for the file chooser
      if (lnf.isNativeLookAndFeel()) {
        try {
          UIManager.setLookAndFeel(UIManager
              .getCrossPlatformLookAndFeelClassName());
        } catch (Exception e) {
          e.printStackTrace();
View Full Code Here


     *
     * @return <code>true</code> if the currently installed Look and feel
     *         is not <code>null</code> and supports window decorations.
     */
    public static boolean lookAndFeelSupportsWindowDecorations() {
        LookAndFeel lnf = UIManager.getLookAndFeel();
        return lnf != null && lnf.getSupportsWindowDecorations();
    }
View Full Code Here

 
// <editor-fold defaultstate="collapsed" desc="initLookAndFeel">
 
  /** Be�ll�tja a form kin�zet�t */
  public static void initLookAndFeel() throws Exception{
    LookAndFeel lf = UIManager.getLookAndFeel();
    if (lf instanceof MetalLookAndFeel) {
      MetalLookAndFeel mlf = (MetalLookAndFeel)lf;
     
      mlf.setCurrentTheme(new DefaultMetalTheme());
      UIManager.setLookAndFeel(mlf);
View Full Code Here

    protected boolean hasDefaultsTab(String lookAndFeelName) {
        return defaultsTablesMap.get(lookAndFeelName) != null;
    }
   
    protected void addDefaultsTab() {
        LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
        JScrollPane scrollPane = new JScrollPane(createDefaultsTable());
        tabPane.addTab(lookAndFeel.getName() + " Defaults", scrollPane);
        defaultsTablesMap.put(lookAndFeel.getName(), scrollPane);
    }
View Full Code Here

        return UIManager.getLookAndFeel().getID().equals("Aqua");
    }


    static void ensureValidCache() {
        LookAndFeel currentLookAndFeel = UIManager.getLookAndFeel();
        if (currentLookAndFeel != cachedLookAndFeel) {
            clearLookAndFeelBasedCaches();
            cachedLookAndFeel = currentLookAndFeel;
        }
    }
View Full Code Here

   * @return The instantiated look and feel
   * @throws Exception
   *             in case of an error
   */
  public static SwingLookAndFeel forName(String className) throws Exception {
    LookAndFeel lookAndFeel = (LookAndFeel) Class.forName(className)
        .newInstance();
    return new SwingLookAndFeel(lookAndFeel.getName(), lookAndFeel
        .getClass().getName());
  }
View Full Code Here

     *
     * @return <code>true</code> if the currently installed Look and feel
     *         is not <code>null</code> and supports window decorations.
     */
    public static boolean lookAndFeelSupportsWindowDecorations() {
        LookAndFeel lnf = UIManager.getLookAndFeel();
        return lnf != null && lnf.getSupportsWindowDecorations();
    }
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

    /**
     * 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

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.