How to make a Window object Transparent

hi all,
how can i make an object of Window Class transparent.
please help me out friends.

This is a transparent window with an orange in it:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.peer.*;
public class Tw extends JWindow implements FocusListener, MouseMotionListener, MouseListener
     Image     img,tim;
     Graphics  tig;
     Point     mp;
     Robot     r;
public Tw()
     setBounds(170,170,100,100);
     try
          r = new Robot();
     catch(AWTException awe)
          System.out.println("robot excepton occurred");
     capture();
     addMouseMotionListener(this);
     addMouseListener(this);
     addFocusListener(this);
     setVisible(true);
public void mouseDragged(MouseEvent m)
     if (mp == null) return;
     Point p = m.getPoint();
     int x = getX()+p.x-mp.x;
     int y = getY()+p.y-mp.y;
     setLocation(x,y);
     paintP(getGraphics());
public void mouseMoved(MouseEvent m)
public void mouseClicked(MouseEvent m){}
public void mouseEntered(MouseEvent m){}
public void mouseExited(MouseEvent m) {}
public void mouseReleased(MouseEvent m)
     mp = null;
public void mousePressed(MouseEvent m)
     mp = m.getPoint();
public void focusGained(FocusEvent fe)
     setSize(0,0);
     capture();
     setSize(100,100);
public void focusLost(FocusEvent fe)
public void capture()
     Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
     img = r.createScreenCapture(new Rectangle(0,0,d.width,d.height));
public void captureX()
     Rectangle rect = getBounds();
     setVisible(false);
     Thread.yield();
     Image xmg = r.createScreenCapture(rect);
     img.getGraphics().drawImage(xmg,rect.x,rect.y,rect.width,rect.height,null);     
     setLocation(rect.x,rect.y);
     setVisible(true);
public void paint(Graphics g)
     Rectangle rect = g.getClipBounds();
     if (tim == null)
          tim = createImage(getWidth(),getHeight());
          tig = tim.getGraphics();
     if (!rect.getSize().equals(getSize())) captureX();
          else                               paintP(g);
public void paintP(Graphics g)
    tig.drawImage(img,0,0,getWidth(),getHeight(),
                       getX(),getY(),getX()+getWidth(),getY()+getHeight(),null);
     tig.setColor(Color.orange);
     tig.fillOval(10,20,70,80);
     tig.setColor(Color.green);
     tig.fillOval(21,16,20,10);
     tig.fillOval(40,02,11,21);
     g.drawImage(tim,0,0,null);
public void update(Graphics g)
     this.paint(g);
public static void main (String[] args) 
     new Tw();
}Noah

Similar Messages

  • PS 6.1, how to make a white background transparant?

    how to make a white background  transparent?

    Select the white background with Magic Wand tool.  Hit Delete.  Transparent background is denoted by the checkerboard pattern on your document.
    Nancy O.

  • How to make the status bar transparent

    can anyone help?

    Here it don`t make the status bar transparent...
    I`m trying to make UINavigationBar transparent too like Photo App and trying it but get nothing:
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
    [navigationController.navigationBar setTintColor:[UIColor colorWithWhite:0.2 alpha:0.6]];
    Some other idea how they do this? An application called Style.com do the same..
    Thank you

  • How to make dos window scrollable under win98?

    Hi, I am using win98, every time when I run my GUI application, whenever I got bunch of error message that can not be displayed in one window, I will miss the original error information. Can anyone tell me how to make my dos window scrollable so that I can view all error message.
    Thanks a lot.

    I don't think that you can do this. There is another way, however: When java throws an exception, if it is not caught in your program, it is sent to the standard error, which is the console. You can simply reset this to be a file, so you can read this to get all the error info. Try using the following code in your main method:
      public static void main(String[] arg) {
        try {
          System.setErr(new PrintStream(new FileOutputStream(new File("Errors"))));
          //instantiate your main class here
          MyClass mc=new MyClass(); //or whatever
        } catch (Exception _ex) {     
          System.out.println("An error occurred"); //exception get sent to standard error automatically, so there
                                  //is no real need to catch this exception. However, I use it to display
                                  //a message on the console to let me know an error has occurred.
          System.err.println(_ex.getMessage()); //and finally, print the exception to file
          _ex.printStackTrace();
      }

  • How to make look an object like a piece of metal?

    hellow guys....i have a question...im kind of new in illustrator and would like to make a plane object to look like a shinning piece of metal with 3D effect....can any one tell me how to achive this? thanks in advance!

    You apply gradients of all sorts using the normal gradient tool, gradient meshes, blends and combine it with other effects like edge bevels.
    Mylenium

  • How to make a selection partially transparent?

    Hi. I open a jpg image in PS, use a quick selection tool to select what I want and then I'd like to make that selection 80% transparent. How do I do that?
    Thank you.

    One way is to convert the background layer to a regular layer, add a layer mask after making the selection, invert the layer mask and use the masks panel to control the transparency (density setting) of the selection.

  • How to make a Graphics2D object from a Graphics object?

    Hallo !
    Graphics g = pj.getGraphics();
    Graphics2D g2 = (Graphics2D) g;I get an Exception as follows:
    java.lang.ClassCastException: sun.awt.windows.WPrintGraphicsWrapper
    Is there an other possibility to to make a Graphics2D Object ? Or can I repair the error on an other way?
    Thank you Wolfgang

    Yes JBuilder makes a reference to this line.
    pj is a PrintJob.
    The only lines in this method for test are
    PrintJob pj = Toolkit.getDefaultToolkit().getPrintJob(p,"PrintWindow",null);
    Graphics g = pj.getGraphics();
    Graphics2D g2 = (Graphics2D) g;
    pj.end();Exception occurred during event dispatching:
    java.lang.ClassCastException: sun.awt.windows.WPrintGraphicsWrapper
    Wolfgang

  • How can java control window object?

    Client side controlling like window.open(), window.close() and window.opener.reload() make me headacid. I have java class to handle controlling. Is there any way java can control window object. like closing/openning popup window?
    Thanks.

    that looks like Javascript not Java
    Java has possibilities to manipulate windows but in the JSP context all that manipulating is nonsense because JSP run at server.

  • How to make UIPagecontrol of UIPageviewController transparent?

    I am using UIPageviewController in my application where i want to make UIPagecontrol of UIPageeviewController transparent.
    While giving background color to clear color its not working but when giving background color to any other color like red itsworking fine.

    With this image, it will be easiest to select the white background.
    1. I would recommend using the Quick Select Tool. Select the white background.
    2. Because you want the lung guy on his own layer not the white background, you need to invert the selection. Select<Inverse.
    3. Copy the lung guy onto his own layer. On PC, press ctrl + J. If on a Mac, the shortcut is cmd + J.
    4. You can now copy/paste lung guy in the desired photo. Alternately, you can drag his layer from the layers palette and drop him into the other document. (If the resolution of lung guy doesn't match your image's resolution, he will shrink or expand as his layer will take on the resolution of the document he is moved into.)
    Note: I would not use the lettering as you can see where the lung guy's image overlaps. It will be an easier project if you redo the lettering in Word or use the Photoshop Element's text tool...maybe with text warp and a layer style....to add the text.

  • How to make a white background Transparent

    I would like to to select the blocks and enclosed data to copy and paste in a poster, leaving out the white background.  In other words make the white background transparent. 
    This is just a plain low res jpg.
    This seems like it would be pretty easy but not for me.  Is there a tutorial that could guide me through this?
    Thank you for any guidance you can give me.

    I'm probably not being clear about what I'm trying to do.  Here's a typical poster.  I use the magnetic lasso to select an image, copy and paste it resulting in this.
    This time it's to be a team picture with small head shots of each player, action photos in the background, similar to this.  I can do all that but I wanted the tournament chart to lay on top of the background with just the boxes and enclosed info showing.  I know I can use the magnetic lasso or the poly lasso but I don't have enough patience for that.

  • How to make background of layer transparent so just the object shows up?....

    Hi, I don't know if there's a way to do what I'm trying to but I'm trying to take a jpg picture that I uploaded onto my photoshop elements editor, then using the maze I have on microsoft word to make a maze out of the picture. I was able to paste the maze over the picture by using the over lay option for the 2nd layer and making it more transparent but the lines are getting too transparent also and you can't see some of the lines at all that is over white areas. Is there another way that I can make it so that the lines (of the maze) only show up and make it so the white background is totally transparent?
    I'm also wondering how I can change the whole background color without affecting the picture or anything else. This is my first time playing with the elements editor, I was just thinking I guess I could make a botttom layer and make the layer the color I want or will it bleed through to the other layers or the other layers just cover it up? I really don't know what I'm doing and really don't know about these layers, I'm surprised I was able to do what I did.
    Thank you for any suggestions or help.
    IDK if I'm explaining this right so here is a link to the image.
    Thanks

    With this image, it will be easiest to select the white background.
    1. I would recommend using the Quick Select Tool. Select the white background.
    2. Because you want the lung guy on his own layer not the white background, you need to invert the selection. Select<Inverse.
    3. Copy the lung guy onto his own layer. On PC, press ctrl + J. If on a Mac, the shortcut is cmd + J.
    4. You can now copy/paste lung guy in the desired photo. Alternately, you can drag his layer from the layers palette and drop him into the other document. (If the resolution of lung guy doesn't match your image's resolution, he will shrink or expand as his layer will take on the resolution of the document he is moved into.)
    Note: I would not use the lettering as you can see where the lung guy's image overlaps. It will be an easier project if you redo the lettering in Word or use the Photoshop Element's text tool...maybe with text warp and a layer style....to add the text.

  • How to make animations float with transparent background

    I am taking a graduate course in adv. web design for an ed
    tech program at a university. Neither my instructor nor anyone else
    in my class knows how to get Flash animations to have a transparent
    background, or even if this is possible. On behalf of us all, I am
    wondering if it is possible to create a Flash animation without a
    background--or with a transparent background, and then superimpose
    it onto a web page so that the web page's background shows through
    all but the animated part. We are using Flash 8. If it is possible,
    can someone please tell us how to do it? I have seen web pages
    where the animations float over the web page. Are these animations
    made with Flash or with another program? Thank you!

    Yes, it's easy, but haven't done it for a while, and not
    since all the new ActiveX stuff on MS IE requires Java Script to
    make the dotted outline go away.
    To do it well takes a combination of Flash with the
    publish-settings HTML Window Mode set to Transparent Windowless,
    and tightly-designed CSS with your animation positioned in a div
    that lies or overlays the exact place on the HTML page where you
    want it. You can even have it scale to the entire visible window,
    which can be quite cool. I did one for the holidays with snow
    falling over an HTML page. It can block lnks from working, though,
    so you can have the div (and animation) disappear when the
    animation is done.

  • How to make a checkbox circle transparent

    I would like to use acrobat to insert checkbox fields on a heathcare form such as the one below.  I would like the checkbox option to be a circle that would circle the number but be transparent to show the number below it.  This may not be possible but I thought I would see if anyone has an idea.  Thanks.

    AcroForms are the forms produced directly in Acrobat with the tools there. You can also get to Designer from Acrobat and create forms there. Once you go to Designer, you can not return to Acrobat for any editing since the Designer PDF is actually a XML package.
    It sounds like you may have used the same selections as I did in AcroForms, though I think you used a check box and not a radio box. I used radio boxes that are a circle by default. The check boxes are squares by default. The basic difference is that the check boxes are either independent (with different names) or identical (with identical names). The radio boxes are either independent (with different names) or only one can be selected at a time (with identical names). Thus, if you name a group of radio boxes with the same name, but different responses, selecting any one will deselect all others with the same name -- probably what you want -- and the response or the name will be the one you have selected. You can change to a square if you want. In AA9 and such, the form will come up with a choice for the user to highlight all fields, in which case there will be a transparent color (typically light blue) for all fields. You can still see through it. When you select a radio button, the number under it will be hidden by the selected icon -- probably OK to clarify a selection. You could always move it to one side if you want, but I think that is the limit of what you can do. The appearance would be a lot like a scan form you fill in with a #2 pencil (like SATs or GREs).
    I mentioned Designer since many folks get there without realizing it. Looks like you did not make it there, but you might want to explore that option on a copy of your form. Designer also has a separate forum named LiveCycle. The data files produced by AcroForms are typically FDF or XFDF (try exporting your data and look at the file differences). HTML is an option, but not as easy to use. Designer data files are XML files. The FDF, XFDF, and XML files can be imported to the form for printing/viewing/data management if you desire. There is no need to send the entire form, only the data. If you have the whole form sent, then you have to activate Reader Rights for users with Reader and come under the 500 use limit of the license (looks like that might be a problem for you, and the price to get around the limit is not something you really want to ask about unless you are flowing in cash).
    Many folks try to use e-mail for form submission. This is prone to problems of having an e-mail package recognized or the computer setup for MAPI, depending on the version of Acrobat and the OS. It is just a potential problem that can be avoided by a web script submission. Your IT folks should be able to help create a short web script to accept the data file and save it for you. With the FDF toolkit, you can also manipulate the FDF data file to extract what you need to a database or elsewhere. There are a lot of options, but you will likely come upon a few more form issues like the one you asked about that will require a bit of a rethink of how you create the form.
    Hopefully that answers your questions to some extent (even if not directly asked).

  • How to make one area less transparent?

    I have an object set to 60% opacity.  I have a text box layered on top of that with white text.  I would the object to be LESS transparent (90%opacity) where it lies under the text box. How can I do this?  thank you.

    Like Peter says, you can duplicate the object, reduce or adjust the shape to sit where you want it less transparent, set it to 30% opacity and maybe add a basic feather so there isn't a hard edge. Or you could try using a  gradient feather within the object and adjust the sliders to suit, but this might be less precise.

  • How to make download window open to front

    When I download a file, how can I make the download window automatically come to the front?

    THANK YOU! I don't know which idiot thought of removing the downloads window in favor of that ridiculous menu but I've been tearing my hair out trying to fix it. The old window has everything you need in one easy window while the menu requires multiple steps to check EACH download. I was ready to drop release 20 and go back to 19.

Maybe you are looking for