Package javax.swing.plaf

Examples of javax.swing.plaf.ProgressBarUI


   * On Mac this will resemble Aqua, on other platforms
   * this will be two chasing arrows.
   */
  public static JProgressBar create() {
    JProgressBar bar = new JProgressBar();
    ProgressBarUI ui;
    if(isMac) {
      ui = new AquaSpinningProgressBarUI();
    } else {
      ui = new BasicSpinningProgressBarUI();
    }
View Full Code Here


      }
    });
  }

  private static boolean isToDispose(final JProgressBar progress) {
    final ProgressBarUI ui = progress.getUI();

    if (ui == null) return false;
    if (Boolean.TYPE.equals(progress.getClientProperty("isDisposed"))) return false;

    try {
      final Field progressBarField = ReflectionUtil.findField(ui.getClass(), JProgressBar.class, "progressBar");
      progressBarField.setAccessible(true);
      return progressBarField.get(ui) != null;
    }
    catch (NoSuchFieldException e) {
      return true;
View Full Code Here

        assertTrue(value.setCurrentAccessibleValue(new Integer(currentValue + 1)));
    }

    public void testSetGetUpdateUI() {
        assertEquals("ProgressBarUI", progressBar.getUIClassID());
        ProgressBarUI defaultUI = progressBar.getUI();
        assertNotNull(defaultUI);
        ProgressBarUI ui = new ProgressBarUI() {
        };
        progressBar.setUI(ui);
        assertEquals(ui, progressBar.getUI());
        progressBar.updateUI();
        assertNotSame(ui, progressBar.getUI());
View Full Code Here

      c.removeMouseWheelListener(each);
    }
  }

  public static void disposeProgress(final JProgressBar progress) {
    final ProgressBarUI ui = progress.getUI();
    if (ui == null) return;

    final Class<? extends ProgressBarUI> uiClass = ui.getClass();
    if (uiClass.getName().equals("apple.laf.CUIAquaProgressBar")) {
      try {
        final Field animatorField = uiClass.getDeclaredField("animator");
        animatorField.setAccessible(true);
        final Object animator = animatorField.get(ui);
View Full Code Here

TOP

Related Classes of javax.swing.plaf.ProgressBarUI

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.