Package javax.swing.plaf.metal

Examples of javax.swing.plaf.metal.MetalLookAndFeel$MetalLazyValue


   * Runs the test using the specified harness.
   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
    harness.check(new MetalLookAndFeel().getName(), "Metal");
  }
View Full Code Here


    harness.check(ui2.getMinimumSize(scrollBar2), new Dimension(16, 48));
   
    // restore a sane look and feel
    try
    {
      UIManager.setLookAndFeel(new MetalLookAndFeel());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

{
  public void test(TestHarness h)
  {
    DefaultMetalTheme theme = new DefaultMetalTheme();
    MetalLookAndFeel.setCurrentTheme(theme);
    MetalLookAndFeel laf = new MetalLookAndFeel();
    Color c1 = laf.getDefaults().getColor("Button.background");
    h.check(c1, theme.getControl());
    MetalLookAndFeel.setCurrentTheme(new TestTheme());
    c1 = laf.getDefaults().getColor("Button.background");
    h.check(c1, Color.red);

    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
  }
View Full Code Here

   
    // set the MetalLookAndFeel and confirm that this icon is used
    // for 'Menu.checkIcon'
    try
    {
      UIManager.setLookAndFeel(new MetalLookAndFeel());
    }
    catch (UnsupportedLookAndFeelException e)
    {
      e.printStackTrace();
    }
View Full Code Here

    harness.check(ui2.getPreferredSize(scrollBar2), new Dimension(16, 48));
   
    // restore a sane look and feel
    try
    {
      UIManager.setLookAndFeel(new MetalLookAndFeel());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

  {
    // this test is theme-dependent
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        // ignore
      }
View Full Code Here

   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted)
   */
  public void test(TestHarness harness) {
    harness.check((new MetalLookAndFeel().isSupportedLookAndFeel()));
  }
View Full Code Here

  {
    // test with DefaultMetalTheme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace()
      }
View Full Code Here

  public void test(TestHarness harness)     
  {  
    // use a known look and feel
    try
      {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (Exception e)
      {
        harness.fail("Problem setting MetalLookAndFeel");
      }
   
    JComboBox c1 = new JComboBox(new Object[] {"A", "B", "C"});
    c1.addPropertyChangeListener(this);
   
    ComboBoxEditor editor = new MetalComboBoxEditor();
    c1.setEditor(editor);
    harness.check(c1.getEditor(), editor);
    harness.check(event.getPropertyName(), "editor");
    harness.check(event.getNewValue(), editor);
   
    // set a new look and feel and see if the editor (which doesn't implement
    // UIResource) gets replaced
    try
      {
        UIManager.setLookAndFeel(new TestLookAndFeel());
      }
    catch (Exception e)
      {
        harness.fail("Problem setting TestLookAndFeel");
      }
    c1.updateUI();
    JComboBox c2 = new JComboBox();
    harness.check(c1.getEditor(), editor);
    harness.check(c2.getEditor() instanceof BasicComboBoxEditor.UIResource);
   
    // restore MetalLookAndFeel so as not to interfere with other tests
    try
      {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (Exception e)
      {
        harness.fail("Problem restoring MetalLookAndFeel");
      }
View Full Code Here

    harness.checkPoint("JMenuBar(constructor)");

    // make sure we're using the MetalLookAndFeel
    try
      {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace();
      }
View Full Code Here

TOP

Related Classes of javax.swing.plaf.metal.MetalLookAndFeel$MetalLazyValue

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.