Floating button not repainting

I have a class (MyButton) that extends JButton. In the class, I'm handling mouse events to make the button "raise up" from a toolbar when the mouse pointer moves across the button (much like buttons on the IE or Netscape toolbars). When the mouse leaves the button, it returns to be flat w/ no borders visible.
Here's the sequence:
1. Mouse enteres the button, it "raises up" from the toolbar.
2. Mouse click the button and it drepresses properly.
3. Release the mouse and the button comes back up to it's "raised" state, as it is supposed to.
4. At this point, the action (MouseReleased or MouseClicked) triggers the mouse event that brings up a separate dialog at which point the button loses focus.
5. The mouse then leaves the button to interact w/ the dialog.
6. When the dialog is dismissed, the button comes back into focus.
7. The problem is that at this point, the button is still as it was w/ the mouse over it (i.e. "raised up" from the toolbar). It should be back level or "flat".
8. When the mouse passes over the button again, it behaves correctly.
I've tried playing w/ the FocusListener, but this doesn't seem to work either.
Ideas?

Got it. As it turns out, I was running ver 1.3.0 of the JRE. When I moved up to 1.3.1, the world got better. There must be a fix relating to that.

Similar Messages

  • Can I make a button not make a slide continue?

    Hi.
    I looked for this question, but could not find an answer, so I'm hoping I'm re-posting something already answered.  If so, I will accept my verbal chasisement.
    Anyway...
    I am attemping to create a "click and reveal' type interaction in Captivate 4 using buttons and hiding/unhiding objects. Essentially, when the user clicks button A, it will reveal image A and Caption A .  When they click button B, through the magic of multiple actions, image A and Caption A will disappear and image B and Caption B will appear....etc.  These buttons are at about 5 or so seconds into the timeline.
    Around 28 seconds into the slide timeline, I have a "Back" and "Next" button that I use for user navigation instead of using the navigation buttons on the skin.  This will pause the slide until the user clicks one of them to be navigated to the next slide or previous slide.
    The problem I am running into is that if the user "lingers" on the slide and clicks back and forth between buttons A, B, C, etc. to re-look at all the objects, clicking on any of those buttons will continue the slide which is paused by the "Back and Next" buttons at the end of the timeline.  Try as I might, I just can't make the slide pause and wait until the user actually clicks the "Next" or "Back" buttons when I click buttons A, B, and C over and over to re-look at the images and captions. 
    So is there any way to tell a button NOT to continue the slide?  I want my buttons A, B, and C to do the multiple actions i have assigned them (show and hide objects) but do NOT want them to make the slide continue at the pause implemented by my navigation buttons.
    Thoughts?
    Thanks.
    Rob

    Hi there
    Actually I do believe there is a way to make the behavior what you want. But I'll address your issue for making things known to Adobe first. Adobe has something called the "Wish Form/Bug Reporting Form" that they monitor. So you use that. (Link to that is in my sig line)
    As for the button issue, you can accomplish it using Advanced Actions. What you need to do is to manipulate the Playhead to keep it paused. One way is by configuring the variable rdcmndGotoFrame with the value rdinfoCurrentFrame. Sometimes this works to just keep the playhead paused. Other times I've tried to do it with some success by repositioning the playhead farther upstream and allowing it to "float" back to the pause point of the object. And to do this you use the variable rdcmndGotoFrameAndResume and assigning it the frame number earlier in time. Of course, to do this you must first calculate the frame number to position at. I normally did this by inserting a Text Caption configured to present the rdinfoCurrentFrame variable and manipulating the pause points using a Click Box object to arrive at the desired value.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • JPanel not repainting if embedded in another panel

    I have a reusable class called as DuplicatorPanel. This class has two add/ remove buttons like in Mac if you are familiar.
    The problem is that the screen gets updated with an extra row in case i have a main method in Duplicator itself. However if i have that in another panel as in HyperlinkBuilder then it does not repaint itself.
    Please can someone help ?
    package sam.dnd;
    import java.awt.event.ActionEvent;
    import java.util.Iterator;
    import java.util.LinkedHashMap;
    import java.util.Map;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public abstract class DuplicatorPanel extends Box {
        private static final long serialVersionUID = 1L;
        private static int oneup = 0;
        private Map<String, JComponent> panelMap = new LinkedHashMap<String, JComponent>();
        private Action addAction;
        private Action removeAction;
        public DuplicatorPanel() {
            super(BoxLayout.Y_AXIS);
            this.initComponents();
            this.placeComponents();
        private void initComponents() {
            addAction = new AddAction();
            removeAction = new RemoveAction();
            addDuplicatorPanel();
        private void placeComponents() {
            Iterator<JComponent> itr = this.panelMap.values().iterator();
            while(itr.hasNext()) {
                JComponent comp = (JComponent) itr.next();
                this.add(comp);
            this.add(Box.createVerticalGlue());
        private void addDuplicatorPanel() {
            int index = oneup++;
            JComponent component = this.createDuplicate();
            JButton btnAdd = new JButton("Add");
            btnAdd.setActionCommand("" + index);
            btnAdd.addActionListener(this.addAction);
            JButton btnRemove = new JButton("Remove");
            btnRemove.setActionCommand("" + index);
            btnRemove.addActionListener(this.removeAction);
            Box box = Box.createHorizontalBox();
            box.add(component);
            box.add(Box.createHorizontalGlue());
            box.add(btnAdd);
            box.add(btnRemove);
            this.panelMap.put("" + index, box);
            fireValueChanged();
        private void fireValueChanged() {
            this.removeAll();
            this.placeComponents();
            this.repaint();
        protected void doAdd() {
            addDuplicatorPanel();
            fireValueChanged();
        protected void doRemove(String key) {
            if(this.panelMap.size() == 1) {
                return;
            JComponent comp = this.panelMap.remove(key);
            if(comp != null) {
                this.fireValueChanged();
        protected abstract JComponent createDuplicate();
        class AddAction extends AbstractAction {
            private static final long serialVersionUID = 1L;
            public void actionPerformed(ActionEvent evt) {
                doAdd();
        class RemoveAction extends AbstractAction {
            private static final long serialVersionUID = 1L;
            public void actionPerformed(ActionEvent evt) {
                JButton source = (JButton) evt.getSource();
                doRemove(source.getActionCommand());
         * @param args
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.add(new MyDuplicatorPanel());
            f.setSize(200, 200);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        static class MyDuplicatorPanel extends DuplicatorPanel {
            private static final long serialVersionUID = 1L;
            public JComponent createDuplicate() {
                return new JLabel("Test");
    }This is another class that calls the above
    package sam.dnd;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import java.util.HashMap;
    import javax.swing.JComboBox;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class HyperLinkBuilder extends JPanel {
        private static final long serialVersionUID = 1L;
         * @param args
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.add(new HyperLinkBuilder());
            f.setSize(200, 200);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        private static HashMap<String, String> linkNameValueMap = new HashMap<String, String>();
        private static HashMap<String, String> paramNameValueMap = new HashMap<String, String>();
        private static HashMap<String, String> valueNameValueMap = new HashMap<String, String>();
        static {
            linkNameValueMap.put("Name1", "Value1");
            linkNameValueMap.put("Name2", "Value2");
            linkNameValueMap.put("Name3", "Value3");
            paramNameValueMap.put("Name1", "Value1");
            paramNameValueMap.put("Name2", "Value2");
            paramNameValueMap.put("Name3", "Value3");
            valueNameValueMap.put("Name1", "Value1");
            valueNameValueMap.put("Name2", "Value2");
            valueNameValueMap.put("Name3", "Value3");
        private String link;
        private JComboBox linkCombo;
        private DuplicatorPanel panel;
        public HyperLinkBuilder() {
            this.initComponents();
            this.placeComponents();
            this.addListeners();
        private void initComponents() {
            linkCombo = new JComboBox(linkNameValueMap.keySet().toArray());
            panel = new MyDuplicatorPanel();
        private void placeComponents() {
            this.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = 0;
            this.add(linkCombo, gbc);
            gbc.gridy++;
            gbc.fill = GridBagConstraints.BOTH;
            this.add(panel, gbc);
        private void addListeners() {
            this.linkCombo.addItemListener(new LinkSelector());
        private JPanel createNameValuePanel() {
            JComboBox nameCombo = new JComboBox(paramNameValueMap.keySet().toArray());
            JComboBox valueCombo = new JComboBox(valueNameValueMap.keySet().toArray());
            JPanel panel = new JPanel();
            panel.add(nameCombo);
            panel.add(valueCombo);
            return panel;
        private void doLinkSelected() {
            String name = (String) linkCombo.getSelectedItem();
            link = linkNameValueMap.get(name);
        public String build() {
            //TODO:
            return this.link;
        class LinkSelector implements ItemListener {
            public void itemStateChanged(ItemEvent e) {
                doLinkSelected();
        class MyDuplicatorPanel extends DuplicatorPanel {
            private static final long serialVersionUID = 1L;
            @Override
            protected JComponent createDuplicate() {
                return HyperLinkBuilder.this.createNameValuePanel();
    }

    Hey Xeon,
    Replace that repaint() with revalidate. That is the trick in there.
    -Sam

  • Whole screen is not repainted, need debug tips

    We are running an application which uses some jogl for animaties.
    Sometimes when the animation is finished and we set the GLCanvas to invisible, the normal
    java JPanels are not repainted.
    Also alt-tab to another windows application and back will not force a redraw.
    The application itself is still working, clicking on a (now) not visible button will trigger
    the jogl animations, and these are show correctly.
    Also from logging it appear that the AWT-thread is not blocking.
    We are looking for tips that can help find us the problem from logging
    as it only appears a few times a week and it is not reproducable.

    The problem is that most of the time it works, but after some hours/days, the java panels are not repainted.
    There is no memory leak.
    paintComponent is not overwritten, a object is made visible to do the animation.
    Pseudo code:
    public class AnimateTilePopup extends JPanel {
    GLCanvas glCanvas;
    public AnimateTilePopup() {
    super(null);
    setOpaque(true);
    glCanvas = new GLCanvas();
    glCanvas.setLocation(0,0);
    glCanvas.setSize(width, height);
    glCanvas.setVisible(false);
    glCanvas.setFocusable(false);
    add(glCanvas);
    flipRendererZoom = new AnimateRendererZoom();
    glCanvas.addGLEventListener(flipRendererZoom);
    public startAnimation() {
    glCanvas.setVisible(true);
    this.setVisible(true);
    public stopAnimation() {
    glCanvas.setVisible(false);
    this.setVisible(false);
    So sometimes when we call stopAnimation(), the animation is stoppped, but the underlying java JPanels are not repainted.
    When we now call startAnimation, the animation is shown and when stopped, no repaint for the normal JPanels.
    Most times it is working perfectly, only sometimes it failes.
    What can be the cause or what logging can be gather that might gives us a clue how to fix this problem.

  • Ipad 3rd gen home button not working

    any suggestions? The iPad is out of warranty. It has been not working for sometime. I've kept in clean, great codition. It is definitely a bug. I am annoyed that apple did not have a recall as I see many people having this same issue. I have an original 1st gen iPad that we use for a TV remote and there is never been an issue with the home button not responding.
    PLease help!

    Enable AssistiveTouch which floats a virtual button on-screen which can mimic all hardware buttons on the device:
    Settings>General>Accessibility>AssistiveTouch: turn ON
    *Note* If your Sleep/Wake (power) button is not functioning and you power off the device using the AssistiveTouch panel (tap the on-screen AssistiveTouch button, Device>Lock Screen (tap and hold to power off)), you will NOT be able to power on the device with the Sleep/Wake (power) button (since it's not functioning). To power on the device in this case, you will need to connect the powered off device either to a PC's USB port or an external charger to power the device back on.

  • What is this floating button??

    No matter where I am at on the 'net...I see this floating "button" that says Custom Google Search Engine .... Here is a link to one web page showing it..... http://www.artscottfotografie.com/photos/i-srPXLSC/0/L/i-srPXLSC-L.jpg
    I do not remeber adding any new add ons and I would really like to know how to permanently disable this thing...it is driving me nuts.
    Thanx
    Art Scott

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • After GLcanvas setVisible(false), normal JPanels sometimes not repainted.

    We are running an application which uses some jogl for animaties.
    Sometimes when the animation is finished and we set the GLCanvas to invisible, the normal
    java JPanels are not repainted.
    Also alt-tab to another windows application and back will not force a redraw.
    The application itself is still working, clicking on a (now) not visible button will trigger
    the jogl animations, and these are show correctly.
    Also from logging it appear that the AWT-thread is not blocking.
    We are looking for tips that can help find us the problem from logging
    as it only appears a few times a week and it is not reproducable.

    The problem is that most of the time it works, but after some hours/days, the java panels are not repainted.
    There is no memory leak.
    Pseudo code:
    public class AnimateTilePopup extends JPanel {
    GLCanvas glCanvas;
    public AnimateTilePopup() {
    super(null);
    setOpaque(true);
    glCanvas = new GLCanvas();
    glCanvas.setLocation(0,0);
    glCanvas.setSize(width, height);
    glCanvas.setVisible(false);
    glCanvas.setFocusable(false);
    add(glCanvas);
    flipRendererZoom = new AnimateRendererZoom();
    glCanvas.addGLEventListener(flipRendererZoom);
    public startAnimation() {
    glCanvas.setVisible(true);
    this.setVisible(true);
    public stopAnimation() {
    glCanvas.setVisible(false);
    this.setVisible(false);
    So sometimes when we call stopAnimation(), the animation is stoppped, but the underlying java JPanels are not repainted.
    When we now call startAnimation, the animation is shown and when stopped, no repaint for the normal JPanels.
    Most times it is working perfectly, only sometimes it failes.
    What can be the cause or what logging can be gather that might gives us a clue how to fix this problem.

  • Logitech mouse buttons not working in photoshop cc 2014

    logitech mouse buttons not working in photoshop cc 2014 winds 8.1. Is this a common problem?
    I have updated the latest drivers and have a few buttons programmed with keyboard shortcuts that used to work in previous versions of Photoshop but don't work now.
    Scrolling with mouse in bridge stopped working in cc butI see it is now working.
    any ideas?

    Many Photoshop extensions are not compatible with Photoshop CC 2014 for Adobe removed support for Flash Panels in CC 2014. Many extensions panels are flash based.  Check with the developer to see if their blendmein extension works with CC 2014.
    Adobe does not maintain Photoshop so it backward compatible with prior versions of Photoshop.  This brakes things like action scripts plugins extensions etc. Keep old version of Photoshop installed....

  • IPhone 4 middle button not working

    Having problems with the iPhone 4 middle button not working anyone else with the same problem ?
    Thanks

    i have the same problem. since you're software is already iOS 5.1 go to settings>general> accessibility>the settings after triple click home, i forgot what is it called but that would help.

  • Iphone 4 Home button not working after upgrade to OS 4.3.5

    Iphone 4 Home button not working after upgrade to OS 4.3.5.Please help!!!!!!!!

    It seems that settings of mail accounts have something to do with it. I've delete my gmail account and am now using Microsoft Exchange. It seems better, yet not perfect. The issue is definitely due to OS 4.3.1
    Apple answer is - no answer. It is a shame that the quality of their products, in terms of design and concept, is not match by a care for customers. It is not normal that I, as a customer, have to spend hours reading Apple Discussions forum to try to understand what the problem is. A little more respect for a customer that spend big $$$ buying their products wouldn't hurt.

  • Iphone 4: Home Button Not Working. The home button only works when it is connected to iTunes, once i disconnet it does not work, i have tried a restore to factory settings but it still is not working. Any suggestions?

    iphone 4: Home Button Not Working. The home button only works when it is connected to iTunes, once i disconnet it does not work, i have tried a restore to factory settings but it still is not working. Any suggestions?

    Apple, as I said, does not repair your iPhone. All hardware service issues are handled by replacing the unit. So they can't handle the home-button issue without also addressing the issue of the cracked screen, for which they'll almost certainly charge you. But you can make an appointment at an Apple Store or call Apple tech support and plead your case.
    Regards.

  • Iphone 4 home button not working, called never fixed, then cracked screen before bringing it back again, will they blame the cracked screen if i bring it back?

    I bought an iPhone 4 less than a year ago, then one day the home button randomly stopped working, I bought the warranty so I decided to call in and see what was wrong with it. The girl said that restoring the phone would correct the problem which it did. But it is only a temporary fix, it happens more often now. So I was meaning to call in soon, but the other day my phone fell out of my pocket IN CASE from a foot height and cracked the screen. I nearly threw up. All the years I have had a phone I have never cracked or broken one, strongest screen my ***. Anyway, if I contact them again now will they fix the home button problem? or will they say that the cracked screen is obviously the cause of the home button not working? which it is not!! I don't care about the screen being cracked its not on the actual screen just on the side so its irrelevant to me. Plus I heard it is outrageosly pricey to replace.

    Apple, as I said, does not repair your iPhone. All hardware service issues are handled by replacing the unit. So they can't handle the home-button issue without also addressing the issue of the cracked screen, for which they'll almost certainly charge you. But you can make an appointment at an Apple Store or call Apple tech support and plead your case.
    Regards.

  • Iphone 4 Home button not working after upgrade to OS 4.3.1

    I've just upgrade my iphone 4 to OS 4.3.1 and I'm having issues with home button not working. Need to hit it several times before I can close an app or wake the iphone. Any one having this issue?

    It seems that settings of mail accounts have something to do with it. I've delete my gmail account and am now using Microsoft Exchange. It seems better, yet not perfect. The issue is definitely due to OS 4.3.1
    Apple answer is - no answer. It is a shame that the quality of their products, in terms of design and concept, is not match by a care for customers. It is not normal that I, as a customer, have to spend hours reading Apple Discussions forum to try to understand what the problem is. A little more respect for a customer that spend big $$$ buying their products wouldn't hurt.

  • Iphone 4 volume buttons not working

    iphone 4 volume and mute buttons not working, checked all settings they are all fine and when headphones in it works??? When I take out headphones the volum buttons do not work, when phone rings or text receives only vibrates???? HELP!!!!

    This could be due to some debris or dirt inside the  headphones jack that makes the iPhone think that the headphones are connected even when they are not.
    Try to see if you can clean the jack being very careful, with canned air as sold in electronics store.  Some people have been successful by introducing and withdrawing the headphones jack several times in a row to displace whatever is in there if it is lodged in.
    Avoid introducing anything else like a pointed object.  You could damage the jack.
    If all of this does not work, I would try first resetting the phone by holding the home button and the power button together for about 15 seconds or until the whilte apple appears, then waiting until the phone resets.  If the problem continues after this, take it to an Apple Store to see what they believe should be done.

  • Button not working in browser

    I am coding a video player in Netbeans 6.8. just find two problems:
    1. the browser button not working in browser when I run the project from Netbeans under "run in browser" mode. however under "standard execution" mode, everything is fine.
    2. can not run the jar file in the project's dist directory directly. in other word, I can not run the jar file outside of Netbeans.
    I appreciate any help. thanks.
    Main.fx:
    package gui;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.paint.Color.*;
    * @author Jethro
    var face=Face{};
    function run(){
        Stage{
            title: "player"
            resizable:false
            scene: Scene{
                width:800
                height:600
                fill:DARKBLUE
                content: [face]
    }Face.fx:
    package gui;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.control.Button;
    import javafx.scene.layout.VBox;
    import javafx.scene.media.Media;
    import javafx.scene.media.MediaPlayer;
    import javafx.scene.media.MediaError;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.media.MediaView;
    import javafx.scene.control.ProgressBar;
    * @author Jethro
    public class Face extends CustomNode {
        public var lbf=LBF{};
        public var enable=true;
        public var mark="play";
        public var sourceOfMedia:String;
        public def player=MediaPlayer {
            repeatCount:MediaPlayer.REPEAT_FOREVER
            onError:function(e:MediaError){
                var er=e.message;
         media : bind Media {
              source: sourceOfMedia
        public def view=MediaView {
                mediaPlayer:bind player
                preserveRatio: true                    
        public def bar=ProgressBar {
                height:10
                width:bind scene.width
                progress: bind
                    if(player.media !=null){
                        player.currentTime.toMillis()
                            /player.media.duration.toMillis();
                    }else{
                        0.0
        public var play=Button {      
            onMousePressed:function(e:MouseEvent){
                if(enable and player.media != null){
                            mark="pause"; println("playing...");                       
                            sourceOfMedia=lbf.uri;
                            player.play();
                            enable=false;
                }else{
                    mark="play";
                    player.pause();println("paused...");
                    enable=true;
         text: bind mark       
        public override function create(): Node {
            return Group {
                content: [
                    VBox{
                        content: [
                            lbf,
                            bar,
                            play,
                            view,
    }LBF.fx:
    package gui;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.control.TextBox;
    import javafx.scene.layout.HBox;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.text.Font;
    import javafx.scene.text.Text;
    import javafx.scene.Node;
    import javafx.geometry.HPos;
    import javafx.geometry.VPos;
    import javafx.scene.control.Button;
    import javax.swing.JFileChooser;
    * @author Jethro
    public class LBF extends CustomNode{
        public var uri:String;
        public var whereis=Text {
            fill:Color.BLUE
         font : Font {
              size: 20
         x: 10, y: 30
         content: "location: "
        public var location=TextBox{
            text:"the song's location"
            columns:40
            selectOnFocus:true
        public var browser=Button {
         text: "Browser"
         action: function() {
                    var jfc=new JFileChooser();               
              jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                    var val = jfc.showOpenDialog(null);
                    if(val == JFileChooser.APPROVE_OPTION) {                   
                        location.text = jfc.getSelectedFile().getAbsolutePath();
                        uri=jfc.getSelectedFile().toURI().toString();
                        println(location.text);
        public var face=Group {
         content: [
              Rectangle {
                        x: 0, y: 0
                        width: 800, height: 50
                        fill: Color.SILVER
                     HBox{
                         width:800
                         height:50
                         hpos:HPos.CENTER
                         vpos:VPos.CENTER
                         spacing:5
                         content: [whereis,location,browser]
        public override function create():Node{
            return face;
    }

    thanks for your reply but I need more specific operation.
    maybe I am not very clear about the problem one. I mean when I run the code in standard mode, if I click the browse button, a window will pop out and I can choose a video file from my local harddisk. but if I run it in "web start execution" mode and "run in browser" mode. the browse button make no response when I click it.
    Edited by: Phoenix2006 on Feb 8, 2010 2:35 PM
    Edited by: Phoenix2006 on Feb 8, 2010 2:37 PM
    Edited by: Phoenix2006 on Feb 8, 2010 2:42 PM

Maybe you are looking for