Package javax.swing.plaf

Examples of javax.swing.plaf.IconUIResource


        UIManager.put("CheckBox.background", new ColorUIResource(Color.blue));
        Font font = new FontUIResource(button.getFont().deriveFont(100f));
        UIManager.put("CheckBox.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.put("CheckBox.border", border);
        Icon icon = new IconUIResource(new ImageIcon(new BufferedImage(10, 10,
                BufferedImage.TYPE_INT_RGB)));
        UIManager.put("CheckBox.icon", icon);
        button.setUI(publicUI);
        publicUI.installDefaults(button);
        publicUI.uninstallDefaults(button);
View Full Code Here


        UIManager.put("CheckBox.background", new ColorUIResource(Color.blue));
        Font font = new FontUIResource(button.getFont().deriveFont(100f));
        UIManager.put("CheckBox.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.put("CheckBox.border", border);
        Icon icon = new IconUIResource(new ImageIcon(new BufferedImage(10, 10,
                BufferedImage.TYPE_INT_RGB)));
        UIManager.put("CheckBox.icon", icon);
        button.setUI(publicUI);
        publicUI.installDefaults(button);
        assertEquals(Color.blue, button.getBackground());
View Full Code Here

    }

    public void testGetIconForType() throws InterruptedException {
        paneUI.optionPane = new JOptionPane();
        paneUI.optionPane.setUI(paneUI);
        Icon icon11 = new IconUIResource(new ImageIcon(new BufferedImage(10, 20,
                BufferedImage.TYPE_INT_RGB)));
        Icon icon21 = new IconUIResource(new ImageIcon(new BufferedImage(30, 40,
                BufferedImage.TYPE_INT_RGB)));
        Icon icon31 = new IconUIResource(new ImageIcon(new BufferedImage(50, 60,
                BufferedImage.TYPE_INT_RGB)));
        Icon icon41 = new IconUIResource(new ImageIcon(new BufferedImage(70, 80,
                BufferedImage.TYPE_INT_RGB)));
        UIManager.put("OptionPane.errorIcon", icon11);
        UIManager.put("OptionPane.informationIcon", icon21);
        UIManager.put("OptionPane.questionIcon", icon31);
        UIManager.put("OptionPane.warningIcon", icon41);
View Full Code Here

        TreePathId pathId = new TreePathId(selectionPath);
        selectedPaths.put(pathId, selectionPath.getLastPathComponent());
      }
    }

    setExpandedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
        this.tree, false)));
    setCollapsedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
        this.tree, true)));

    // instead of computing the cell renderer insets on
    // every cell rendering, compute it once and expose to the
    // SubstanceDefaultTreeCellRenderer
View Full Code Here

          // Icon of the color picker tool
          "ColorChooser.colorPickerIcon",
          new UIDefaults.LazyValue() {
            @Override
            public Object createValue(UIDefaults table) {
              return new IconUIResource(SubstanceImageCreator
                  .getSearchIcon(15, colorScheme, true));
            }
          },

          // Magnifying glass used as the cursor image
View Full Code Here

      g2d.drawImage(result, 0, 0, null);
      g2d.dispose();
      result = intermediate;
    }

    return new IconUIResource(new ImageIcon(result));
  }
View Full Code Here

          }
        }
      } else if ("icon".equalsIgnoreCase(tagName)) {
        final URL iconURL = new URL(url, element.getProperty("VALUE"));
        ImageIcon icon = new ImageIcon(SkinUtils.loadImage(iconURL));
        UIManager.put(element.getProperty("NAME"), new IconUIResource(icon));
        // put the default internal icon at work for JOptionPane too
        if ("InternalFrame.icon".equals(element.getProperty("NAME"))) {
          JOptionPane.getRootFrame().setIconImage(icon.getImage());
        }
      }
View Full Code Here

  }

  private IconUIResource createIconUIResourceFromPng(String name)
  {
    URL url = getClass().getResource(iconspath + name);
    return new IconUIResource(url != null ? new ImageIcon(url) :
                              new ImageIcon(""));
  }
View Full Code Here

                graphics.fillRect(0, 0, image.getWidth(), image.getHeight());
                graphics.setColor(Color.RED);
                graphics.drawLine(0, 0, image.getWidth(), image.getHeight());

                // Use IconUIResource as an icon, because with ImageIcon bug is not reproduced
                JButton button1 = new JButton(new IconUIResource(new ImageIcon(image)));

                JButton button2 = new JButton(new IconUIResource(new ImageIcon(image)));

                button2.setEnabled(false);

                if (button1.getPreferredSize().getHeight() != button2.getPreferredSize().getHeight()) {
                    fail("Two similar buttons have different size");
View Full Code Here

      g2d.drawImage(result, 0, 0, null);
      g2d.dispose();
      result = intermediate;
    }

    return new IconUIResource(new ImageIcon(result));
  }
View Full Code Here

TOP

Related Classes of javax.swing.plaf.IconUIResource

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.