Transparent Buttons

is it possible to create a transparent button? I want to place a button on top of an image, but I want to be able to see the image through the button.

in Swing, setOpaque(false) will be good. But AWT won't make transarent buttons

Similar Messages

  • How do I make a completely Transparent Button in Flash Builder

    Hello, I am building an app and need a completely transparent button, Ive tried making one but nothing would happen when you clicked on it.
    Thanks for the help.

    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 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

  • Transparent Buttons in Java Swing?

    Hi!
    I want to create transparent Buttons using java swing for my desktop application. Can any one tell me how to do it?

    I can help, but it depends on what you mean by "transparent".
    Do you mean TOTALLY transparent, or slightly transparent, or merely translucent? Do you want the text on the button to be in any way transparent? You really need to be more specific.
    Basically, though, the concept is pretty simple. All swing components have several methods that can be overridden by somebody who knows what they are doing, in order to customize their appearances.
    Some of these are: paint(), paintComponent(), ComponentUI.paint(), etc.
    You need to determine the right place to put the new code. Then you extend the class, and change the transparency of the graphics object passed into the method in question, and then pass control to the super implementation of that method.
    There are some traps you need to make sure you avoid, though:
    1. If you want transparent components, you MUST have the opaque property of the component set to false. Otherwise, the components beneath your transparent button will never update.
    2. When you start messing with a graphics object to create transparency, you need to make sure that you revert your changes to the graphics object when you are finished, because all painting uses the same graphics object -> so if you set your button transparent, and then forget to remove the transparency, all objects drawn after the button will also be drawn transparent.
    A word of caution:
    This sort of manipulation is not hard, but you NEED to understand the painting model for SWING. There are a few articles hosted by sun that can help you in this respect.
    Good Luck!
    - Adam

  • I lost that when i highlight a sentence i see three transparent buttons appear (copy-search by google-babelfish translate) how can i restore them?

    during reading a text, when i highlight a word i see three transparent buttons appear below this word (copy-search by Google-Babelfish translate) but i lost these buttons when i reinstalled Firefox, how can i restore them?, they make my work faster and more efficient.
    == This happened ==
    Just once or twice
    == when i reinstalled Firefox

    i was just pointing you in the right direction
    thanks for the star and ... happy computing !
    JGG

  • Search and replace a clickbox for a transparent button?

    Is it possible to replace all click boxes for transparent buttons in a project?
    Why? Because you can style a transparent button. You cannot style (as far as i know) a clickbox.
    Ton.

    LOL, so Transparent Buttons aren't really what you want. Well, technically they may be, but you really don't want an honest to goodness transparent button.
    Because you will need to re-create the functionality of the button, I might think it would be simpler to just add either a Rectangle Drawing Object or a Highlight Box and layer it over the top of the Click Boxes. But that's just me.
    No, there is no functionality I'm aware of that will magickally transform all Click Boxes to Transparent Buttons. But nothing is stopping folks from requesting it via the Wish Form.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How to make transparent buttons?

    Is there a way to make transparent button. A sort of fake button that way, I can make many of them and have just one big background image at the back to save loading time but still able to capture clicks in specific area. Anyone?

    [button setAlpha: 0.0];

  • Color transparent Button

    hi all
    i wanna create color transparent button..
    can we do it in java? i search and try for few hours already
    but only can do the transparent.. i want have a soft color transparent in my button how to do that
    thx
    import java.awt.AlphaComposite;
    import javax.swing.JFrame;
    import java.awt.Color;
    import java.awt.Cursor;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GraphicsEnvironment;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import javax.swing.ImageIcon;
    import javax.swing.Timer;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class test_ys_button_fade extends JFrame{  
        public test_ys_button_fade(){       
            tes_panel panel = new tes_panel();              
            add(panel);
            panel.setLayout(null);
            setBackground(Color.WHITE);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            setSize(400,400);
            setVisible(true);
            setTitle("tes fade");
        public static void main(String[] args){
            new test_ys_button_fade();
    class tes_panel extends JPanel{       
        JButton[] bOpen = new JButton[5];   
        int iPosisiy;
        public tes_panel(){       
            //init_timer();
            for (int ilu=1;ilu<=1;ilu++){
                iPosisiy = (ilu*50) + 20;
                bOpen[ilu] = new TransparentButton("test");   
                /*bOpen[ilu] = new myButton(" Open ", 250, 20, 60, iPosisiy, ilu);
                bOpen[ilu].addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        BrowserControl.OpenURL("http://www.ipmart.com");
                });//emd ActionListener*/
                add(bOpen[ilu]);
            }//end for
        class TransparentButton extends JButton {
            BufferedImage buttonImage = null;
            int animationDuration = 1000; // each animation will take 2 seconds
            long animationStartTime;
            boolean boA=false;
            Timer index_timer;
            float alpha = 0.0f; // current opacity of button 
             public TransparentButton(String text) {
                 //super(text);
                 setOpaque(false); 
                 setFocusPainted(false);
                 setBorderPainted(true);
                 setContentAreaFilled(false);
                 setCursor(new Cursor(Cursor.HAND_CURSOR));
                 setVisible(true);
                 setSize(250, 20);
                 setLocation(60, iPosisiy);
                 //setBackground(Color.GREEN);
                 setBackground(new Color(50, 50, 50, 255));
                 addMouseListener(new MouseAdapter(){    
                 public void mouseEntered(MouseEvent evt) {
                    if(!boA){
                        animationStartTime = System.nanoTime() / 1000000;
                        ActionListener IndexTask = new ActionListener(){
                            public void actionPerformed(ActionEvent evt) {
                                boA=true;
                                long currentTime = System.nanoTime() / 1000000;
                                long totalTime = currentTime - animationStartTime;
                                if (totalTime > animationDuration) {
                                    System.out.println("ahahaha " + getName());
                                    index_timer.stop();
                                    alpha = 0.0f;
                                    boA=false;
                                float fraction = (float) totalTime / animationDuration;
                                fraction = Math.min(1.0f, fraction);
                                alpha = 1-(Math.abs(1 - (2 * fraction)));
                                int iId = 1;
                                bOpen[iId].repaint();
                        };//ActionListener
                        index_timer = new Timer(30, IndexTask);
                        index_timer.start();
             public void paint(Graphics g) {
                 Graphics2D g2 = (Graphics2D) g.create();
                 g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
                 super.paint(g2);
                 g2.dispose();
                 //g2.setColor(new Color(255, 0, 0, 20));
        protected void paintComponent(Graphics g){
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g.setColor(Color.GRAY);
            g.fillRect(0, 0, getWidth(), getHeight());
    }

    A demonstration below. The only time it dosen't work is when the LAF dosen't honor the background color set on the button (there's only one such LAF on my machine --> Vista LAF). In this case the LAF paints over the color I filled the button with.
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.Color;
    import java.awt.AlphaComposite;
    import javax.swing.*;
    import javax.swing.UIManager.LookAndFeelInfo;
    public class ButtonTest {
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new ButtonTest().createAndShowGUI();
        private JFrame frame;
        private JButton opaqueButton1;
        private JButton opaqueButton2;
        private SoftJButton softButton1;
        private SoftJButton softButton2;
        public void createAndShowGUI() {
            opaqueButton1 = new JButton("Opaque Button");
            opaqueButton2 = new JButton("Opaque Button");
            softButton1 = new SoftJButton("Transparent Button");
            softButton2 = new SoftJButton("Transparent Button");
            opaqueButton1.setBackground(Color.GREEN);
            softButton1.setBackground(Color.GREEN);
            frame = new JFrame();
            frame.getContentPane().setLayout(new java.awt.GridLayout(2,2,10,10));
            frame.add(opaqueButton1);
            frame.add(softButton1);
            frame.add(opaqueButton2);
            frame.add(softButton2);
            frame.setSize(567,350);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            Timer alphaChanger = new Timer(30,new ActionListener() {
                float incrementer = -.03f;
                public void actionPerformed(ActionEvent e) {
                    float newAlpha = softButton1.getAlpha() + incrementer;
                    if(newAlpha < 0) {
                        newAlpha = 0;
                        incrementer = -incrementer;
                    }else if(newAlpha > 1f) {
                        newAlpha = 1f;
                        incrementer = -incrementer;
                    softButton1.setAlpha(newAlpha);
                    softButton2.setAlpha(newAlpha);
            alphaChanger.start();
            Timer uiChanger = new Timer(3500,new ActionListener() {
                LookAndFeelInfo[] laf = UIManager.getInstalledLookAndFeels();
                int index = 1;
                public void actionPerformed(ActionEvent e) {
                    try{
                        UIManager.setLookAndFeel(laf[index].getClassName());
                        SwingUtilities.updateComponentTreeUI(frame);
                    }catch(Exception exc) {
                        exc.printStackTrace();
                    index = (index+1) % laf.length;
            uiChanger.start();
        public static class SoftJButton extends JButton {
            private static final JButton lafDeterminer = new JButton();
            private boolean rectangularLAF;
            private float alpha = 1f;
            public SoftJButton() {
                this(null,null);
            public SoftJButton(String text) {
                this(text,null);
            public SoftJButton(String text, Icon icon) {
                super(text,icon);
                setOpaque(false);
                setFocusPainted(false);
            public float getAlpha() {
                return alpha;
            public void setAlpha(float alpha) {
                this.alpha = alpha;
                repaint();
            public void paintComponent(java.awt.Graphics g) {
                 java.awt.Graphics2D g2 = (java.awt.Graphics2D) g;
                 g2.setComposite(AlphaComposite.getInstance(
                         AlphaComposite.SRC_OVER,alpha));
                 if(rectangularLAF && isBackgroundSet()) {
                     Color c = getBackground();
                     g2.setColor(c);
                     g.fillRect(0,0,getWidth(),getHeight());
                 super.paintComponent(g2);
            public void updateUI() {
                super.updateUI();
                lafDeterminer.updateUI();
                rectangularLAF = lafDeterminer.isOpaque();
    }

  • Transparent Buttons in ie8 cropped

    I have noticed that if you place a photoshop button with transparency.  In i.e.8 the right side of the button gets cut off.  I changed the background-size: contain to background-size: 100% in the css and problem is solved.  Looks great in all browsers and ie.  You may want to look into using 100% instead of contain until Microsoft disappears.
    Enjoy.

    I can help, but it depends on what you mean by "transparent".
    Do you mean TOTALLY transparent, or slightly transparent, or merely translucent? Do you want the text on the button to be in any way transparent? You really need to be more specific.
    Basically, though, the concept is pretty simple. All swing components have several methods that can be overridden by somebody who knows what they are doing, in order to customize their appearances.
    Some of these are: paint(), paintComponent(), ComponentUI.paint(), etc.
    You need to determine the right place to put the new code. Then you extend the class, and change the transparency of the graphics object passed into the method in question, and then pass control to the super implementation of that method.
    There are some traps you need to make sure you avoid, though:
    1. If you want transparent components, you MUST have the opaque property of the component set to false. Otherwise, the components beneath your transparent button will never update.
    2. When you start messing with a graphics object to create transparency, you need to make sure that you revert your changes to the graphics object when you are finished, because all painting uses the same graphics object -> so if you set your button transparent, and then forget to remove the transparency, all objects drawn after the button will also be drawn transparent.
    A word of caution:
    This sort of manipulation is not hard, but you NEED to understand the painting model for SWING. There are a few articles hosted by sun that can help you in this respect.
    Good Luck!
    - Adam

  • Upload image on transparent buttons

    i cant seem to get this right.
    i want to upload an image of fixed dimensions or varying on transparent buttons(say a matrix grid or 3*3); so that i can assign a tool-tip text messages to each of those buttons. when i click on any of the buttons or on mouse-over, those text messages should show up as a tool-tip text.
    i hope i have conveyed my problem correctly.
    Thanks in advance.

    but i dont want to add an icon. i want to upload an image on a fixed grid of 3*3 OR 4*4 transparent buttons. this will be done by the admin and a text message allocated to each of the buttons. so that, when a user can see that tool-tip-text on mouse-over or click of that area occupied by a button.

  • Make transparent "buttons" just for function?

    I tried to make hyperlinks when I click text of vita, art,
    statement, for example.
    I just want to make sure what I am doing is right.
    - Instead of making buttons for each of text ( i.e., vita,
    art, statement),
    - I will make one transparent "button" symbol (which means
    just 0% alpha setting for color on Up/Over/Down but some color on
    Hit state).
    - then I will place this transparent button under the each
    text.
    - then, select each button, and make get URL actionscript.
    Is this transparent button will work do you think?
    One more question. If I put this button under "statement"
    text, can I scale to make bigger enough to cover the text?
    Or do you make each button symbols for vita, art, statement
    of text?
    Thanks in advance!

    >> Instead of making buttons for each of text ( i.e.,
    vita, art,
    >> statement), I will make one transparent "button"
    symbol
    That's a good way to go. :)
    >> (which means just 0% alpha setting for color on
    Up/Over/
    >> Down but some color on Hit state).
    Actually, *all* you need is some shape on the Hit frame. The
    other
    frames can be empty. That makes it easiest.
    >> then I will place this transparent button under the
    each text.
    I would place it over each text, not under.
    > then, select each button, and make get URL actionscript.
    Sure. Or any other action.
    >> If I put this button under "statement" text, can I
    scale to
    >> make bigger enough to cover the text?
    Absolutely.
    >> Or do you make each button symbols for vita, art,
    statement
    >> of text? Thanks in advance!
    No, no! Use one single button symbol -- that's the whole
    point: one
    symbol used for many purposes ... saves on SWF file size and
    makes your
    Library less cluttered.
    > yes, it will work. yes, you can scale it using the free
    transform
    > tool (q)..but remember if you copy and paste it, to
    change the
    > url in the actions cause it will have the same url you
    copied from.
    That all depends on how you're handling those button events.
    Back in
    Flash 5 (that's quite a while ago), you had to use on() or
    onClipEvent(),
    but since Flash MX (aka 6), it's been possible to put all
    your code into a
    single script layer. This is the current recommended "best
    practice," and I
    agree with it. Just give each button instance -- in this
    case, each copy of
    that single "invisible" button -- an instance name. You
    accomplish that by
    selecting each button on the Stage, in turn, and filling in
    the Instance
    Name field in the Property inspector.
    Then use each instance name in a frame script and assign a
    function to
    the Button.onRelease event for each:
    buttonA.onRelease = function() {
    getURL("
    http://www.domain.com/page.html");
    buttonB.onRelease = function() {
    getURL("
    http://www.domain.com/some_where_else.html");
    // etc.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Transparent Button Link to URL not working when I publish

    I am using mulitple tranparent buttons (over text) as a link to open a URL file in a seperate window on our company intranet.  I created this file 6 months ago and it always works fine.  Today, I needed to update the file and add another transparent button to link to a new url.  When I preview the file, everything works fine and a browser window will open showing the correct web page but when I publish the file, nothing happens.  None of the links work.
    I have updated this file in the past and I have never had a problem.  Does anyone have any suggestions.  This should be a two minute update for me but has turned into a big problem. 
    Thanks,
    Jeff

    Hi Jeff
    What you might consider doing is to declare a common output folder. Then flag that folder as safe. Normally that's a one off and it just holds. But you do have the option of clearing the list of "safe" folders. Perhaps something clobbered that at some point.
    Additionally, once you copy the content to a web server and view it in the browser using a URL, you shouldn't have any concerns. The link should work for all users.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Need to lock position of a transparent button in a Mac Projector

    Hi
    I am running a Projector file on a touch screen kiosk.  The basic index screen on the kiosk has 18 transparent buttons overlaying text on an underlying graphic.  The buttons are have a background transparency set at 20% in order to identify the boundries of the button.
    My problem is that anyone touching the buttons on the touch screen can drag the button away from its intended fixed position.  I have locked the button sprite in the authoring mode but that does not seem to lock its position in the projector.  Any thoughts or help would be greatly appreciated.
    Projector is running on a MAC mini with OS 10.5.7.
    Thanks
    Rockodyne

    My problem is that anyone touching the buttons on the touch screen can drag the button away from its intended fixed position.
    Then you have either added code somewhere to allow the user to do this, or the sprite(number).moveableSprite property is TRUE for them all (which is something you can set using the Property Inspector -> Sprite tab - it's the Moveable button above the sprite Name entry field)

  • Transparent Buttons Look Unusably Hideous in Acrobat DC

    I've been working on a PDF catalog for over a month now, and one of the features I had built into the InDesign document was some transparent rollovers. There is also a navigation sidebar that uses transparency to get the look I want. These items were looking great in previous versions of Acrobat, but now in Acrobat DC they look ABSOLUTELY AWFUL. Like, unusable. Something is messed up with the transparency rendering of buttons.
    Is anyone else experiencing this issue with Acrobat DC?
    Please tell me this is a bug that will be fixed immediately. I'm hoping to send this catalog out to clients in two weeks, but now if any of them have upgraded to Acrobat DC, they'll get interactive elements that look disgusting and unreadable. Which makes our company look bad. Which I am NOT AT ALL happy about. !

    Yes, I'm having the exact same problem. I upgraded to Acrobat DC and now a project I'm working on with transparent buttons looks horrible. Not sure what to do. It looks fine in Reader but if anyone opens it in Acrobat DC it will look terrible. Here's a comparison of the buttons as they look in:
    Reader
    and Acrobat DC

  • Transparent buttons in Encore CS4?

    Hi there.
    I'm just starting with Encore CS4, so I don't know too much about it. I want to create a menu button that is invisible, but when I select it, it becomes visible. To show you what I'm trying to do, I made a screenshot:
    http://img404.imageshack.us/img404/6621/menuwd.jpg
    You see those small white dots on the map. I want those to be visible at all times. And when one of them is selected, I want the white circle to appear (hence it should be there, but set to 100% transparency as long as it is not selected). Also, a small text should appear when the button is selected.
    I found options to make the layers visible or invisible, but I didn't manage to find an option in which I can make the layers visible again when they're being selected.
    Any hints on how to achieve this?

    Mr.D,
    1) If you want to create a button that is transparent you can create it in photoshop easiest. In Encore, if your asset/layer/button isn't already a button, right click on your asset/layer/button/and click "convert to button" . Once that is done, right click somewhere on your menu and click edit in photoshop.
    2) In Photoshop the layers will be in grouped folders. Locate your button/layer there and then duplicate the layer that you are trying to make transparent.
    3) Rename your button layers to read like this: "Name of button (=1)" and "Layer 1 copy" . And turn both of the layers off (Click the eye feature next to the layer so that they are not seen anymore) This will make your button invisible/transparent. When you save the project in photoshop the feature should carry over to encore.
    Once this is done when you mouse over the area where the button is it should highlight with the same shape as your button is and act like a rollover button on the web.
    Hope this helps!

Maybe you are looking for