How make my panel transparent?

pleze help
how make my background panel is transparent in awt

Don't pay 300$ for that, just use JPanelThe OP specifically requested AWT, not Swing. If you're going to recommend mixing heavyweight and lightweight components, you should at least warn of the consequences. See here: [url http://java.sun.com/products/jfc/tsc/articles/mixing/]Mixing Heavy and Light Components

Similar Messages

  • How to make frames/panels transparent?

    Say I wanted to have a window that had rounded edges, or a weird shape. Is there a way to create transparency on a frame so I can pull off this effect?

    http://forum.java.sun.com/thread.jspa?threadID=789490

  • How to make the panel with scrollpane transparent?

    Thanks Camicker for your help, it solves the problem but i got a new problem i.e. i want to make that panel with scrollbar transparent for this i have tried setOpaqe(false) for both scrollpane and panel but it doesn't work. do u have any solution?

    I think camickr (not Camicker) already told you to set the opacity of the JScrollPane's viewport.
    Spend just a few minutes with the JScrollPane API and you'll find an exploded view showing the components that make up a scroll pane.
    db

  • How to make a JPanel transparent? Not able to do it with setOpaque(false)

    Hi all,
    I am writing a code to play a video and then draw some lines on the video. For that first I am playing the video on a visual component and I am trying to overlap a JPanel for drawing the lines. I am able to overlap the JPanel but I am not able to make it transparent. So I am able to draw lines but not able to see the video. So, I want to make the JPanel transparent so that I can see the video also... I am posting my code below
    import javax.media.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import java.lang.Math;
    import javax.media.control.FramePositioningControl;
    import javax.media.protocol.*;
    import javax.swing.*;
    class MPEGPlayer2 extends JFrame implements ActionListener,ControllerListener,ItemListener
         Player player;
         Component vc, cc;
         boolean first = true, loop = false;
         String currentDirectory;
         int mediatime;
         BufferedWriter out;
         FileWriter fos;
         String filename = "";
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         JButton bn = new JButton("DrawLine");
         MPEGPlayer2 (String title)
              super (title);
              addWindowListener(new WindowAdapter ()
                   public void windowClosing (WindowEvent e)
                            dispose ();
                            public void windowClosed (WindowEvent e)
                         if (player != null)
                         player.close ();
                         System.exit (0);
              Menu m = new Menu ("File");
              MenuItem mi = new MenuItem ("Open...");
              mi.addActionListener (this);
              m.add (mi);
              m.addSeparator ();
              CheckboxMenuItem cbmi = new CheckboxMenuItem ("Loop", false);
              cbmi.addItemListener (this);
              m.add (cbmi);
              m.addSeparator ();
              mi = new MenuItem ("Exit");
              mi.addActionListener (this);
              m.add (mi);
              MenuBar mb = new MenuBar ();
              mb.add (m);
              setMenuBar (mb);
              setSize (500, 500);
              setVisible (true);
         public void actionPerformed (ActionEvent ae)
                        FileDialog fd = new FileDialog (this, "Open File",FileDialog.LOAD);
                        fd.setDirectory (currentDirectory);
                        fd.show ();
                        if (fd.getFile () == null)
                        return;
                        currentDirectory = fd.getDirectory ();
                        try
                             player = Manager.createPlayer (new MediaLocator("file:" +fd.getDirectory () +fd.getFile ()));
                             filename = fd.getFile();
                        catch (Exception exe)
                             System.out.println(exe);
                        if (player == null)
                             System.out.println ("Trouble creating a player.");
                             return;
                        setTitle (fd.getFile ());
                        player.addControllerListener (this);
                        player.prefetch ();
         }// end of action performed
         public void controllerUpdate (ControllerEvent e)
              if (e instanceof EndOfMediaEvent)
                   if (loop)
                        player.setMediaTime (new Time (0));
                        player.start ();
                   return;
              if (e instanceof PrefetchCompleteEvent)
                   player.start ();
                   return;
              if (e instanceof RealizeCompleteEvent)
                   vc = player.getVisualComponent ();
                   if (vc != null)
                        add (vc);
                   cc = player.getControlPanelComponent ();
                   if (cc != null)
                        add (cc, BorderLayout.SOUTH);
                   add(new MyPanel());
                   pack ();
         public void itemStateChanged(ItemEvent ee)
         public static void main (String [] args)
              MPEGPlayer2 mp = new MPEGPlayer2 ("Media Player 2.0");
              System.out.println("111111");
    class MyPanel extends JPanel
         int i=0,j;
         public int xc[]= new int[100];
         public int yc[]= new int[100];
         int a,b,c,d;
         public MyPanel()
              setOpaque(false);
              setBorder(BorderFactory.createLineBorder(Color.black));
              JButton bn = new JButton("DrawLine");
              this.add(bn);
              bn.addActionListener(actionListener);
              setBackground(Color.CYAN);
              addMouseListener(new MouseAdapter()
                             public void mouseClicked(MouseEvent e)
                   saveCoordinates(e.getX(),e.getY());
         ActionListener actionListener = new ActionListener()
              public void actionPerformed(ActionEvent aae)
                        repaint();
         public void saveCoordinates(int x, int y)
                    System.out.println("x-coordinate="+x);
                    System.out.println("y-coordinate="+y);
                    xc=x;
              yc[i]=y;
              System.out.println("i="+i);
              i=i+1;
         public Dimension getPreferredSize()
    return new Dimension(500,500);
         public void paintComponent(Graphics g)
    super.paintComponent(g);
              Graphics2D g2D = (Graphics2D)g;
              //g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
              g2D.setColor(Color.GREEN);
              for (j=0;j<i;j=j+2)
                   g2D.drawLine(xc[j],yc[j],xc[j+1],yc[j+1]);

    camickr wrote:
    "How to Use Layered Panes"
    http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html
    Add your video component to one layer and your non-opaque panel to another layer.Did you try that with JMF? It does not work for me. As I said, the movie seems to draw itself always on top!

  • How can i reduce the saturation of a image to make it almost transparent ?

    how can i reduce the saturation of a image to make it almost transparent ?

    You're talking about two different things:
    "Saturation" means the amount of colour, so you would use a Hue/Saturation adjustment layer to lower the saturation to make the image (or layer) appear more "black and white".
    "Transparency" is set by reducing the value of the "Opacity" in the Layers panel.  If that Opacity adjustment isn't available for the layer you want to make more transparent, first double-click on the layer to change it from a "Background" layer to a regular layer.
    Ken

  • [iPhone] How to make one color transparent on a UIImage?

    On my iPhone app I have a UIImage instance. I want to get a derived a UIImage that is the result of the first UIImage where one of its colors (e.g. magenta) is made transparent. How can I do this?
    NOTE: I cannot make the color transparent in Photoshop, the UIImage is created on the fly by the user. I need to do the "postprocessing" on the phone itself, after the user is done "drawing" the image.

    jubgb
    I still do not know your version of Premiere Elements and  your computer operating system, but here is a plan that would probably work for Premiere Elements 11, 12/12.1, and 13/13.1 on Windows 7, 8, or 8.1 64 bit.
    But you say that you are starting with a black and white image. If you could start with the color version of the image, I think we have a promising path to have the fake blood appear in color on a black and white image.
    This would be done by applying the Color Pass effect to the color photo version. Color Pass Effect is  found under fx Effects/Image Control/Color Pass.
    Then you would edit the Color Pass effect under Applied Effects Tab/Appied Effects Palette/Color Pass Panel expanded. But I find that the most effective editing of that effect is done using the Setup whose icon appear to the right of the Color Pass Panel.
    Have you used the Color Pass effect before?
    https://helpx.adobe.com/premiere-elements/using/effects-reference.html
    I will offer how to suggestion for its use if interested. As for starting with the black and white, then I need to think about that some more.
    ATR

  • How do i make psd files transparent?

    How do i make psd images transparent when I drag and drop the layer onto the stage on flash cs6?
    For  example the way iv been doing it up until now was saving as a psd then  going to file import to library on flash. This is very very time  consuming and would be much easyer if i can just drag and drop the  photoshop layer onto the stage, but the problem is that the image gets a  white box around it and isn't transparent when i do that.
    Is there an option in photoshop or flash to fix this and make the background trasnparent?

    Reminds me of Yoshi from Mario Bros
    I know what you'd like to do but as the first reply mentioned, you can't do that. Until Photoshop is updated to copy with transparency intact to the Windows clipboard, you won't be able to do that. The reason I linked and showed a screenshot of the software GIMP is to prove that it's a Photoshop limitation, not a limitation of Flash or the Windows clipboard.
    Knowing that fact, there is no way for you to copy/paste drag/drop from Photoshop directly into Flash.
    Cartoon animating is essentially identical to how most games work. You create one large master image that contains all the possible variations of your subject (a face, a car, etc) and import that into a game. You do the same when animating, only you're keeping them all separate instead of one image.
    Knowing your experience with Flash is small and growing, I'm not going to make the most optimal recommendation. I'll stick to 2 things I mentioned before but elaborate on them.
    1) Save your assets to actual PNGs with transparency, then import into Flash.
    The reason I'd recommend this the most is because of Flash's update function (which I will explain) and it can be automated a bit (also will be explained).
    So I grabbed a Yoshi sprite sheet and say I made a new pose as you mentioned. In Photoshop I'd then select and copy this new pose alone, with transparency:
    As you know, once you do that you can bring up a 'New Image' dialog and it will already have the size of your copied pixels (with trimmed transparency):
    You can see the size is correct and the preset is clipboard. After that you just paste your new image in and turn off the background to gain transparency. Then you save it out as a separate file. I always use Save For Web for a pinch of file size optimization and overall control:
    Again, I realize this is a lot more than you want to do, but all of this can be automated which will be explained after making it virtually a single button push operation.
    Now we have the image as a separate new PNG image with transparency intact. This image should be imported into Flash's library:
    Now you both have a physical separate copy of this pose in a PNG file (which can be useful for many reasons) and Flash can use that file with it's built in update command for very quick changes.
    Now say you touch up a pose a bit. I'll make it really obvious and change the entire hue. You make your changes in Photoshop, follow the same process (even making size changes to the original image), eventually overwriting the PNG you created for that pose:
    Now in Flash, all you need to do is use the Update function. Right-click on the image in your library, select Update. Because this is a file with a physical location, that is all that is needed to change the image in Flash:
    The power in this is if you make sweeping changes to dozens or hundreds of PNGs, you can do this in one command in Flash. Select all the changed images and hit Update and all your changes will be done at once. You can't do things like this when you copy and paste directly into Flash.
    That said, almost all of the steps above can be automated using Photoshops Actions panel. No need to reinvent the wheel, Actions are fully explained here:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7448a.h tml
    I would recommend recording the action after you make your marquee selection around what you want to save as a PNG. Record right up to Save For Web and stop there. Then in the future you press the hotkey you assign and it will extract your selection, open a new document, paste it in, disable the background for transparency and bring you to the dialog you can name the image in. That's pretty easy and automated. Then just import into Flash and enjoy the benefits.
    2) Use Photoshop to create the assets, then a different program to copy/paste into Flash
    Not ideal to need 2 programs, however if you really want to copy and paste directly into Flash, this is the way to go. Get any program that can read the PSD file format, open your PSD in it. If you have enough RAM this really shouldn't be an issue (PS and GIMP side by side, same file open):
    As you make changes to the PSD, just hit reload or revert in your "copy with transparency" supporting program, copy what you need, paste into Flash:
    I'll explain some of the advantages of the previous workflow if you'd like but I think this is enough information overload for now.

  • Anyone know how to make an "Index Transparent" gif

    I have successfully made transparent PNGs and GIFusing an Alpha transparency but now I need to make images which would be the same as ueing fireworks / Photoshop to make a colour transparent. i.e. indexed transparency.
    Does anyone know how to do this.
    My code is as follows :
    // configure all of the parameters
    String text = "ABC abc XYZ xyz ["+ new Date()+"]";
    String font_file = "./tst/Maiandb.TTF";
    font_file = request.getRealPath(font_file);
    float size = 30.0f;
    Color background = Color.white;
    Color color = Color.black;
    Font font = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(font_file));
    font = font.deriveFont(size);
    buffer = new java.awt.image.BufferedImage(1,1,java.awt.image.BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = buffer.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    java.awt.font.FontRenderContext fc = g2.getFontRenderContext();
    java.awt.geom.Rectangle2D bounds = font.getStringBounds(text,fc);
    // calculate the size of the text
    width = (int) bounds.getWidth();
    height = (int) bounds.getHeight();
    // prepare some output
    buffer = new java.awt.image.BufferedImage(width, height, java.awt.image.BufferedImage.TYPE_INT_ARGB);
    g2 = buffer.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
    g2.setFont(font);
    // actually do the drawing
    Color transparent = new Color(0, 0, 0, 0);
    g2.setColor(transparent);
    g2.fillRect(0,0,width,height);
    g2.setColor(color);
    g2.setComposite(AlphaComposite.SrcOver);
    g2.drawString(text,0,(int)-bounds.getY());
    File file = new File ("./jsp1/tst/fred1.gif");
    com.gif4j.light.GifImage gifImage = new com.gif4j.light.GifImage();
    com.gif4j.light.GifFrame gifFrame = new com.gif4j.light.GifFrame(buffer);
    gifImage.addGifFrame(gifFrame);
    GifEncoder.encode(gifImage, file);Thanks in advance

    ^^EDIT^^
    System admins updated iMac to OS X Mountain Lion (10.8.4).

  • How to make opaque white transparent?

    I have a JPEB, black words, hand lettered, on white.
    When I place it into an InDesign doc, on a solid color, the white background, being opaque, covers the solid color.
    How do I make that opaque white into a transparent background? Two manuals do not give me a clue.
    Thanks.

    larry red miller wrote:
    So if I go back to the original .psd file, a transparency option will
    materialize in one of the menus?
    No.. Photoshop transparency is automatically seen in Indesign for .psd files. All you need to make the background transparent in Photoshop.
    larry red miller wrote:
    Well, uhh, that is what I wanted to k now. Where do I find those methods?
    If you Google for "remove background in Photoshop" you will literally find THOUSANDS of tutorials.

  • How to make a completely transparent button in Flash Builder

    I am making a mobile application, and I am wondering how to make a completely transparent button. I've tried using
    <s:Button x="-5" y="0" width="410" height="1504"
                                    skinClass="spark.skins.mobile.TransparentNavigationButtonSkin" click="navigator.pushView(Sun)"/>
    But it still has one line on the side. I need a way to make it completely transparent.
    Thanks,
         8th grade student

    Try this alpha="0.001"
    Also add useHandCursor="true" and buttonMode="true" if you wish to have the hand cursor appear on hover.
    example  x="10" y="10" width="169" height="54" label="Button" alpha="0.001" useHandCursor="true" buttonMode="true" 
    HTH

  • How to make s:Panel middle in Flex4

    When I use <mx:Panel>,I find <mx:Panel> replaced by <s:Panel>.I can make <mx:Panel> middle by using following parameter:
    paddingTop="10"
    paddingLeft="10"
    layout="vertical"
    horizontalAlign="center"
    verticalAlign="middle"
    Then I use <s:Panel>,but I don't know how to make <s:Panel> middle both horizon and vertical. How to do it?
    Thanks.

    Please try:  horizontalCenter="0" in the s:Panel.

  • How to make a Frame transparent?

    Hi everyone:
    I want to make a Frame transparent,it is possible?I find all the API but no result : (
    More, I want to increate my Frame's Height ,but it can't work. code is:
    Frame f=new Frame("Test");
    for(int i=0;i<6;i++){
    f.setSize(40,i * 10);
    }If I change to code to
    f.setSize(40,10);
    f.setSize(40,20);
    f.setSize(40,30);
    ...................It can work well.But why ? It is so complicated . : (
    Please help me

    More
    How to add a hyperlink Text in Frame? When I click it which can open a web site?

  • How can I make a Panel's Title Wordwrap?

    Is there a way to make a panel's title be multiline? I've got a panel where the title is dynamic. I don't know how long the title will be. As it works now, the the title occaisionally gets cut-off. Is there a way to wordwrap a panel's title?
    <mx:Panel id="mySchoolPanel" " 
              title="{myTitle}"
             width="230"
             x="710" y="150"
             headerHeight="50" >
    Thank you.
    -Laxmidi

    The layout logic of Panel appears to assume a single line of text in the title, so to get word-wrapping you may need to extend the class. I had a go at it below - will probably need some tweaking:
    package
        import mx.containers.Panel;
        public class WrappingPanel extends Panel
            // Hard coded padding above and below title text. Should be broken-out
            // into a style.
            private static const HEADER_PADDING : int = 6;
            protected override function createChildren():void
                super.createChildren();
                titleTextField.wordWrap = true;
            protected override function getHeaderHeight():Number
                // Set the header height dynamically based on the height of the title
                return titleTextField.measuredHeight + HEADER_PADDING * 2;
            protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                super.updateDisplayList( unscaledWidth, unscaledHeight );
                // Set the height of the title to fit all text
                titleTextField.height = titleTextField.measuredHeight;
                // Position the title
                titleTextField.y = HEADER_PADDING;

  • How can i repair my logo and make the fill transparent, in ID CC?

    I am first time user for InDesign CC how can i repair my logo and make the fill transparent, in ID CC?

    No I did it InDesign CC, ill try illustrator, but I was able to fill in with a light grey that made the other parts of logo stand out, so I may just leave it that way.

  • How can I make a page transparent in InDesign CS4?

    Hello and thank you all for your help in advance!
    I would like to make a page transparent in InDesign.
    When the magazine is printed it will be an overlay page with font printed on it where you can still see the image underneath. I was wondering if this is possible.
    I'm not quite sure if it has a technical name to it or not so I uploaded a picture of what I'm speaking about to Tinypic.
    http://i46.tinypic.com/29m1vk3.jpg
    (routes and lines on top on the semi-transparent page, map on next)
    Thanks for your help!
    Nora

    will these subjects actually be printed on separate pages or do you want to overlay some images on one page with type on the same page?
    If the former, add and use layers; if the latter design one page and save it as a pdf. Place that pdf on a lower level layer, lock the layer, and work on a higher layer.

Maybe you are looking for