Esempio n. 1
0
  Timed() throws AWTException {
    // super("Trial by fire");
    setLayout(new FlowLayout());

    label.setFont(
        new Font(
            label.getFont().getName(), label.getFont().getStyle(), label.getFont().getSize() + 6));
    Container content = getContentPane();
    content.add(label, JLabel.CENTER);
    addMouseMotionListener(this);
    addMouseListener(this);

    javax.swing.Timer t = new javax.swing.Timer(1000, this);
    setUndecorated(true);
    com.sun.awt.AWTUtilities.setWindowOpacity(this, 0.6f);

    // system tray
    mItem1.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            System.exit(0);
          }
        });

    popup.add(mItem1);
    systray.add(tray);
    tray.setImageAutoSize(true);
    t.start();
  }
Esempio n. 2
0
 public static void main(String[] args) {
   JFrame frame = new JFrame("Clock by Volkman");
   frame.setContentPane(new Clock().getForm());
   frame.pack();
   Toolkit tk = Toolkit.getDefaultToolkit();
   Dimension dim = tk.getScreenSize();
   AWTUtilities.setWindowOpacity(frame, (float) 0.25);
   frame.setLocation((int) dim.getWidth() - 400, 20);
   frame.removeNotify();
   frame.setUndecorated(true);
   frame.setVisible(true);
   frame.setAlwaysOnTop(true);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 }
Esempio n. 3
0
 public void applyProperty(final CPlatformWindow c, final Object value) {
   AWTUtilities.setWindowOpacity(
       c.target, value == null ? 1.0f : Float.parseFloat(value.toString()));
 }