title: java clickable-through non transparent Component in a transparent clickable-through jframe
body: <p>OS = Ubuntu; JDK = 1.7.0_10</p>
  
  <p>General: </p>
  
  <p>What I want is something commonly available as desktop widget (e.g. annotate for compiz or gromit), is there a way to do it in Java? </p>
  
  <p>I want to create one jframe or window to be full-screen, transparent, clickable-though and always on top.
  Inside the jframe I want to add/remove components (text, images, rectangles..) to be positioned on a specific point of the screen. Those component should be non-trasparent and always on top. If possible they should allow to click through.</p>
  
  <p>Example: 
  I have several app opened on my desktop.
  I want to automatically draw a box around window which is on focus drawing a rectangle around the window, the area of the rectangle should be transparent and clickable-thsough in order to allow me to use my application.</p>
  
  <p>Problems:</p>
  
  <p>I can create a transparent frame which stays on top but is not clickable-through, but The component what I will ad to the frame will be in any case transparent.</p>
  
  <pre><code>JFrame frame = new JFrame("MyFrame");
  frame.setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize());
  frame.setLocation(0,0);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH); 
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setUndecorated(true);
  frame.setAlwaysOnTop(true);
  frame.setAlwaysOnTop(true);
  //frame.getRootPane().putClientProperty("apple.awt.draggableWindowBackground", false);     //apple
  frame.getContentPane().setLayout(new BorderLayout());
  System.setProperty("sun.java2d.noddraw", "true");
  AWTUtilities.setWindowOpaque(frame, false);
  AWTUtilities.setWindowOpacity(frame, 0.0f);
  JLabel label = new JLabel("Hello NOT transparent label");
  label.setOpaque(true);
  label.setBackground(new Color(255, 0, 0));
  frame.getContentPane().add(label);
  frame.pack();
  frame.setVisible(true);
  </code></pre>
  
  <p>I can make the frame transparent and clickable-through by setting the IconImage with a transparent image loaded from URL. 
  This works if the image is loaded from an URL but not if I load the image from a local file (why?!?). 
  Also in this case, when I add a component to the frame is not displayed.</p>
  
  <pre><code>try {
  frame.setIconImage(Toolkit.getDefaultToolkit().getImage(new URL("http://i.imgur.com/xtZK0.png")));
  } catch (MalformedURLException e) {e.printStackTrace();}
  </code></pre>
  
  <p>I tried to add a JFXPanel but no success, I tried adding the component to the GlassPane but no success..</p>
  
  <p>After one week of intensive tests and search I hope someone can give me a solution or the right hint.</p>
  
  <p>Thanks.</p>