Package javax.swing

Examples of javax.swing.LookAndFeel


            list.setModel(deserialized);
        }
    }
   
    public void testMetalLookAndFeel() {
        LookAndFeel plaf = new MetalLookAndFeel();
        String originalXml = xstream.toXML(plaf);
        assertBothWays(plaf, originalXml);
    }
View Full Code Here


   * Fixes a bug in the "Nimbus" Look and Feel.
   *
   * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6723524
   */
  private static void fixNimbusTables() {
    LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
    if (lookAndFeel.getClass().toString().contains("NimbusLookAndFeel")) {
      UIDefaults defaults = lookAndFeel.getDefaults();
      defaults.remove("Table.alternateRowColor");
      defaults.put("Table.showGrid", Boolean.TRUE);
      defaults.put("Table.gridColor", new ColorUIResource(203, 209, 216));
      defaults.put("Table.intercellSpacing", new DimensionUIResource(1, 1));
      defaults.put("Table.background", new ColorUIResource(242, 242, 242));
View Full Code Here

  protected Application initApplication(final ExtendedProperties config, final String[] args) throws Exception {
//    Does not work with Nimbus look&feel
//    System.setProperty("com.apple.mrj.application.apple.menu.about.name", "eWorld");
//    System.setProperty("apple.laf.useScreenMenuBar", "true"); 
   
    LookAndFeel laf = UIManager.getLookAndFeel();
    final String lafPath = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
    try {           
      UIManager.setLookAndFeel(lafPath);           
    } catch (Exception e) {
      UIManager.setLookAndFeel(laf);
View Full Code Here

              .setCurrentTheme((com.jgoodies.looks.plastic.PlasticTheme) Class.forName(colorScheme)
                      .newInstance());
      com.jgoodies.looks.Options.setPopupDropShadowEnabled(true);
      UIManager.put("jgoodies.popupDropShadowEnabled", Boolean.TRUE);

      LookAndFeel lnf = (LookAndFeel) getClass().getClassLoader().loadClass(
              "com.jgoodies.looks.plastic.PlasticXPLookAndFeelIritgo").newInstance();

      UIManager.setLookAndFeel(lnf);

      UIManager.getLookAndFeelDefaults().put("ClassLoader", getClass().getClassLoader());
View Full Code Here

        UIManager.LookAndFeelInfo[] installedLafs = UIManager.
                getInstalledLookAndFeels();
        for (UIManager.LookAndFeelInfo lafInfo : installedLafs) {
            try {
                Class<?> lnfClass = Class.forName(lafInfo.getClassName());
                LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance());
                if (laf.isSupportedLookAndFeel()) {
                    String name = lafInfo.getName();
                    SupportedLaF supportedLaF = new SupportedLaF(name, laf);
                    supportedLaFs.add(supportedLaF);
                    if (NIMBUS_LAF_NAME.equals(name)) {
                        nimbusLaF = supportedLaF;
View Full Code Here

                    chooser.setMultiSelectionEnabled(true);
                }
            } else if (c == lafComboBox) {
                SupportedLaF supportedLaF = ((SupportedLaF) lafComboBox.
                        getSelectedItem());
                LookAndFeel laf = supportedLaF.laf;
                try {
                    UIManager.setLookAndFeel(laf);
                    SwingUtilities.updateComponentTreeUI(frame);
                    if (chooser != null) {
                        SwingUtilities.updateComponentTreeUI(chooser);
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

            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

    protected static boolean isMetalSteel() {
        if (!UIManager.getLookAndFeel().getName().equals("Metal")) {
            return false;
        }
        try {
            LookAndFeel laf = UIManager.getLookAndFeel();
            laf.getClass().getMethod("getCurrentTheme", new Class[0]);
            return false;
        } catch (Exception e) {
        }
        return true;
    }
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.