javax.swing.JFrame.setOpacity()方法的使用及代码示例

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

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

JFrame.setOpacity介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JFrame testFrame=new JFrame ();
testFrame.setUndecorated(true);    // Frame is required to set undecorated for changing shape and transparency
testFrame.setOpacity(0.3f);

代码示例来源:origin: stackoverflow.com

window.dispose();
  window.setUndecorated(true);
  window.setOpacity(0.5f);
  setOpaque(false);
} else {
  window.dispose();
  window.setOpacity(1f);
  window.setUndecorated(false);
  setOpaque(true);

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
public void setOpacity(float aValue) {
  opacity = aValue;
  if (surface instanceof JDialog) {
    ((JDialog) surface).setOpacity(opacity);
  }
  if (surface instanceof JInternalFrame) {
    ((JInternalFrame) surface).setOpaque(opacity > 0.5f);
  }
  if (surface instanceof JFrame) {
    ((JFrame) surface).setOpacity(opacity);
  }
}

代码示例来源:origin: stackoverflow.com

Go_Shadow.getModel().addChangeListener(new ChangeListener() {
  @Override
  public void stateChanged(ChangeEvent e) {
    ButtonModel model = (ButtonModel) e.getSource();
    JFrame window = (JFrame) SwingUtilities.getWindowAncestor(TextFrame.this);
    if (model.isArmed() && model.isPressed()) {
      window.setUndecorated(true);
      window.setOpacity(0.5f);
      setOpaque(false);
    } else if (model.isArmed() && !model.isPressed()) {
      setOpaque(true);
      window.setOpacity(1f);
      window.setUndecorated(false);
    }
  }
});

代码示例来源:origin: com.metsci.glimpse/glimpse-docking

frame.setOpacity( 0.5f );
content.setBackground( null );
break;

代码示例来源:origin: com.eas.platypus/platypus-js-forms

frame.setUndecorated(undecorated);
if (frame.isUndecorated()) {
  frame.setOpacity(opacity);

相关文章

JFrame类方法