javax.swing.JWindow.setBackground()方法的使用及代码示例

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

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

JWindow.setBackground介绍

暂无

代码示例

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

frame.setBackground(new Color(0,0,0,0));
frame.setContentPane(new TranslucentPane());
frame.add(new JLabel(new ImageIcon(ImageIO.read(getClass().getResource("/Puppy.png")))));

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

final JWindow window = new JWindow() {
     private static final long serialVersionUID = -132452345234523523L;
     @Override
     public void paint(Graphics g) {
       Graphics2D g2 = (Graphics2D) g.create();
       g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
       Rectangle windowRect = new Rectangle(getSize());
       g2.setColor(new Color(255, 255, 255, 0));
       g2.draw(new RoundRectangle2D.Float(windowRect.x, windowRect.y, windowRect.width, windowRect.height, 85, 85));
       g2.drawImage(img, 0, 0, null);
       g2.dispose();
     }
   };            
   window.setBackground(new Color(0,0,0,0));

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

JWindow frame = new JWindow();
frame.setBackground(new Color(0, 0, 0, 0));

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

mediaPlayerComponent = new EmbeddedMediaPlayerComponent() {
     @Override
     protected Window onGetOverlay() {
       final JWindow transparentWindow = new JWindow();
       // Set basic window opacity if required - the window system must support WindowTranslucency (i.e. PERPIXEL_TRANSLUCENT)!
       transparentWindow.setOpacity(0.8f);
       // White with transparent alpha channel - WindowTranslucency is required for translucency.
       transparentWindow.setBackground(new Color(1.0f, 1.0f, 1.0f, 0.0f));
       final JLabel superImposedLightweigtLabel = new JLabel("Hello, VLC.", JLabel.CENTER);
       superImposedLightweigtLabel.setOpaque(false);
       transparentWindow.getContentPane().add(superImposedLightweigtLabel);
       return transparentWindow;
     }
   ...
  }

代码示例来源:origin: org.jclarion/clarion-runtime

public void configureColor(JWindow jw, PropertyObject target) {
  Color c;
  c = getColor(target, Prop.FONTCOLOR);
  if (c != null)
    jw.setForeground(c);
  c = getColor(target, Prop.BACKGROUND);
  if (c != null)
    jw.setBackground(c);
}

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

popup2.setLocation((int)(floc.getX()+loc.getX())+20, (int)(floc.getY()+loc.getY())+40);
popup1.setBackground(Color.YELLOW);
popup1.setVisible(true);
popup2.setVisible(true);

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

frame.setBackground(new Color(0, 0, 0, 0));
frame.setContentPane(new ShapedPane());
frame.pack();

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

JWindow subFrame = new JWindow();           
subFrame.setBounds(0, 0, 500, 500);
subFrame.setAlwaysOnTop(true);
subFrame.setOpacity(0.50f);
subFrame.setBackground(new Color(1.0f, 1.0f, 1.0f, 0.05f));

JButton button = new JButton("Hello");
button.setBounds(20, 180, 100, 40);

subFrame.getContentPane().setLayout(null);
subFrame.getContentPane().add(button);
subFrame.setVisible(true);

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

public class TranslucentWindow {

  public static void main(String[] args) {
    new TranslucentWindow();
  }

  public TranslucentWindow() {
    EventQueue.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
        }

        JWindow window = new JWindow();
        window.setSize(100, 100);
        window.setBackground(new Color(255, 0, 0, 128));
        window.setLocationRelativeTo(null);
        window.setVisible(true);

      }
    });
  }

}

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

window.add(new JLabel(""), BorderLayout.SOUTH);
window.setOpacity(0.5f);
window.setBackground(new Color(0, 0, 0, 0));
window.setSize(new Dimension(200, 100));
return window;

代码示例来源:origin: undera/jmeter-plugins

hoverWindow.setBackground(gradientColor);
hoverWindow.add(hoverLabel, BorderLayout.CENTER);
registerHoverInfo();

代码示例来源:origin: kg.apc/jmeter-plugins-cmn-jmeter

hoverWindow.setBackground(gradientColor);
hoverWindow.add(hoverLabel, BorderLayout.CENTER);
registerHoverInfo();

代码示例来源:origin: org.apache.xmlgraphics/batik-slideshow

w.setBackground(Color.black);
w.getContentPane().setBackground(Color.black);
w.getContentPane().add(this);

代码示例来源:origin: comtel2000/fx-experience

public void init() {
 setLayout(new BorderLayout());
 // create javafx panel
 final JFXPanel javafxPanel = new JFXPanel();
 javafxPanel.setFocusable(false);
 javafxPanel.setOpaque(false);
 add(javafxPanel, BorderLayout.CENTER);
 JWindow fxKeyboard = new JWindow();
 fxKeyboard.setModalExclusionType(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
 fxKeyboard.getContentPane().add(javafxPanel);
 fxKeyboard.setFocusable(false);
 fxKeyboard.setBackground(null);
 fxKeyboard.pack();
 fxKeyboard.setLocationByPlatform(true);
 // create JavaFX scene
 Platform.runLater(() -> createScene(javafxPanel));
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

w.setBackground(Color.black);
w.getContentPane().setBackground(Color.black);
w.getContentPane().add(this);

代码示例来源:origin: PsiLupan/MakeLobbiesGreatAgain

this.setOpaque(false);
frame = new JWindow();
frame.setBackground(new Color(0, 0, 0, 0));
frame.setFocusableWindowState(false);

代码示例来源:origin: apache/batik

w.setBackground(Color.black);
w.getContentPane().setBackground(Color.black);
w.getContentPane().add(this);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

win.setBackground(bg);
win.setForeground(fg);
java.awt.Point p=getLocationOnScreen();

相关文章