javax.swing.JMenuItem.repaint()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中javax.swing.JMenuItem.repaint()方法的一些代码示例,展示了JMenuItem.repaint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.repaint()方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:repaint

JMenuItem.repaint介绍

暂无

代码示例

代码示例来源:origin: com.jidesoft/jide-oss

private void repaint() {
  if (menuItem != null) {
    menuItem.repaint();
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

public void focusLost(FocusEvent e) {
    menuItem.repaint();
  }
};

代码示例来源:origin: com.jidesoft/jide-oss

public void focusLost(FocusEvent e) {
    menuItem.repaint();
  }
};

代码示例来源:origin: com.jidesoft/jide-oss

public void focusLost(FocusEvent e) {
    menuItem.repaint();
  }
};

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseExited(MouseEvent e) {
  setMouseOver(false);
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void focusGained(FocusEvent e) {
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void focusGained(FocusEvent e) {
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void focusGained(FocusEvent e) {
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseExited(MouseEvent e) {
  setMouseOver(false);
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseExited(MouseEvent e) {
  setMouseOver(false);
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseExited(MouseEvent e) {
  setMouseOver(false);
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void mouseExited(MouseEvent e) {
  setMouseOver(false);
  menuItem.repaint();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if (name.equals("labelFor") || name.equals("displayedMnemonic") ||
        name.equals("accelerator")) {
      updateAcceleratorBinding();
    }
    else if (ButtonStyle.BUTTON_STYLE_PROPERTY.equals(name)
        || "opaque".equals(name)
        || AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY.equals(name)
        ) {
      if (e.getSource() instanceof JMenuItem) {
        JMenuItem lbl = ((JMenuItem) e.getSource());
        lbl.repaint();
      }
    }
    else if (name.equals("text") || "font".equals(name) ||
        "foreground".equals(name)) {
      // remove the old html view client property if one
      // existed, and install a new one if the text installed
      // into the JLabel is html source.
      JMenuItem lbl = ((JMenuItem) e.getSource());
      String text = lbl.getText();
      BasicHTML.updateRenderer(lbl, text);
    }
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if (name.equals("labelFor") || name.equals("displayedMnemonic") ||
        name.equals("accelerator")) {
      updateAcceleratorBinding();
    }
    else if (ButtonStyle.BUTTON_STYLE_PROPERTY.equals(name)
        || "opaque".equals(name)
        || AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY.equals(name)
        ) {
      JMenuItem lbl = ((JMenuItem) e.getSource());
      lbl.repaint();
    }
    else if (name.equals("orientation")) {
      JMenuItem lbl = ((JMenuItem) e.getSource());
      lbl.invalidate();
      lbl.repaint();
    }
    else if (name.equals("text") || "font".equals(name) ||
        "foreground".equals(name)) {
      // remove the old html view client property if one
      // existed, and install a new one if the text installed
      // into the JLabel is html source.
      JMenuItem lbl = ((JMenuItem) e.getSource());
      String text = lbl.getText();
      BasicHTML.updateRenderer(lbl, text);
    }
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void mouseExited(MouseEvent evt) {
    super.mouseExited(evt);
    JMenu menu = (JMenu) evt.getSource();
    ButtonModel model = menu.getModel();
    if (menu.isRolloverEnabled()) {
      model.setRollover(false);
      menuItem.repaint();
    }
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void mouseEntered(MouseEvent evt) {
  super.mouseEntered(evt);
  JMenu menu = (JMenu) evt.getSource();
  if (menu.isTopLevelMenu() && menu.isRolloverEnabled()) {
    menu.getModel().setRollover(true);
    menuItem.repaint();
  }
}

代码示例来源:origin: igniterealtime/Spark

public void finished() {
    refreshButton.setIcon(SparkRes.getImageIcon(SparkRes.REFRESH_IMAGE));
    refreshButton.validate();
    refreshButton.repaint();
    refreshItem.setIcon(SparkRes.getImageIcon(SparkRes.REFRESH_IMAGE));
    refreshItem.validate();
    refreshItem.repaint();
}
};

代码示例来源:origin: igniterealtime/Spark

@Override
public void finished() {
    refreshButton.setIcon(SparkRes.getImageIcon(SparkRes.BUSY_IMAGE));
    refreshButton.validate();
    refreshButton.repaint();
    refreshItem.setIcon(SparkRes.getImageIcon(SparkRes.BUSY_IMAGE));
    refreshItem.validate();
    refreshItem.repaint();
}
};

代码示例来源:origin: com.jidesoft/jide-oss

setMouseOver(true);
menuItem.repaint();

代码示例来源:origin: com.jidesoft/jide-oss

setMouseOver(true);
menuItem.repaint();

相关文章

JMenuItem类方法