Mouse over JButton

I have an 10 x 10 array of JButtons in my project. I was just wondering how do i find out which button the mouse cursor is over at any given time?
I was trying to get x y mouse coordinates but how do i know over which JButton I am?
Thanks for any advice
Regards

Could anybody help me with answer: How could I execute below method:
public void mouseMoved(MouseEvent e) {
          System.out.println("Mouse over Button");
     }without clicking on the button. I have MouseListener on each button. I can exetue this method only when i'm clicking on button. What's wrong with my code? I wanna execute this method when my mouse is over the button :-(. Could help me with my example?
thanks in advance.
regards.
package gui;
import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.util.ArrayList;
import java.util.EventObject;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTree;
import javax.swing.event.ChangeEvent;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeCellEditor;
import javax.swing.tree.TreeCellRenderer;
public class TreeSample {
     JTree tree = null;
     CheckBoxNodeRenderer renderer;
     public void showTree() {
          JFrame frame = new JFrame("Tree");
          ArrayList<Object> ipDevice = new ArrayList<Object>();
        ipDevice.add("IP Device");
        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root");
        DefaultMutableTreeNode node = new DefaultMutableTreeNode(new CheckBoxNode("IP Device", false));
        rootNode.add(node);
        tree = new JTree(rootNode);
        renderer = new CheckBoxNodeRenderer();
        tree.setCellRenderer(renderer);
        tree.setCellEditor(new CheckBoxNodeEditor(tree));
        tree.setEditable(true);
        frame.setSize(400,400);
        frame.add(tree);
        frame.setVisible(true);
     public static void main(String args[]) {
          System.out.println("Test");
          TreeSample ts = new TreeSample();
          ts.showTree();
class CheckBoxNodeRenderer implements TreeCellRenderer {
    private JButton leafRenderer = new ButtonCreator("TEST");
    protected JButton getLeafRenderer(){
        return leafRenderer;
    public CheckBoxNodeRenderer() {
    public Component getTreeCellRendererComponent(JTree tree, Object value,
            boolean selected, boolean expanded, boolean leaf, int row,
            boolean hasFocus) {
        Component returnValue;
        returnValue = leafRenderer;
        return returnValue;
class CheckBoxNodeEditor extends AbstractCellEditor implements TreeCellEditor, MouseMotionListener {
    CheckBoxNodeRenderer renderer = new CheckBoxNodeRenderer();
    ChangeEvent changeEvent = null;
    JTree tree1;
    DefaultMutableTreeNode editedNode;
    public CheckBoxNodeEditor(JTree tree) {
        this.tree1 = tree;
    public Object getCellEditorValue() {
        JButton checkbox = renderer.getLeafRenderer();
        return checkbox;
    public boolean isCellEditable(EventObject event) {
        return true;
    public boolean shouldSelectCell(EventObject ev) {
         return true;
    public Component getTreeCellEditorComponent(final JTree tree, Object value,
            boolean selected, boolean expanded, boolean leaf, int row) {
        System.out.println("GetTree");
        Component editor = renderer.getTreeCellRendererComponent(tree, value,
                true, expanded, true, row, true);
        return editor;
     public void mouseDragged(MouseEvent e) {
     public void mouseMoved(MouseEvent arg0) {
class CheckBoxNode {
    String text;
    boolean selected;
    public CheckBoxNode(String text, boolean selected) {
        this.text = text;
        this.selected = selected;
    public boolean isSelected() {
        return selected;
    public void setSelected(boolean newValue) {
        selected = newValue;
    public String getText() {
        return text;
    public void setText(String newValue) {
        text = newValue;
class ButtonCreator extends JButton implements MouseMotionListener {
     public ButtonCreator() {
          this.addMouseMotionListener(this);
     public ButtonCreator(String p_name) {
          this.setText(p_name);
          this.addMouseMotionListener(this);
     public void mouseDragged(MouseEvent e) {
     public void mouseMoved(MouseEvent e) {
          System.out.println("Mouse over Button");
}

Similar Messages

  • How to Resize JButton,JTextArea and JTextFields on Mouse Over....

    Hi All...
    Hi friends.. I want to be implement my java swing application Resize the Width and Height wise of JButton,JLabel,JTextFields on mouse over etc.
    ============================
    Arjun Palanichamy.
    Senior Programmer.
    Chennai-India.

    Hi All...
    I am herewith enclosed my sample code for resize the JButton(),But This one resize the when will be extend the Button Caption letters,But i want mouse click resize the without button caption or with caption.
    sample code :
    package Resize;
    import java.awt.Container;
    import java.awt.FlowLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import java.awt.ComponentOrientation;
    public class ReButton{
    public static boolean RIGHT_TO_LEFT = false;
    public static void addComponents(Container contentPane) {
    if (RIGHT_TO_LEFT) {
    contentPane.setComponentOrientation(
    ComponentOrientation.RIGHT_TO_LEFT);
    contentPane.setLayout(new FlowLayout());
    contentPane.add(new JButton("1"));
    contentPane.add(new JButton("100"));
    contentPane.add(new JButton("100 100"));
    contentPane.add(new JButton("100 100 100"));
    contentPane.add(new JButton("100 100 100 100"));
    contentPane.add(new JButton("5"));
    private static void createAndShowGUI() {
    JFrame frame = new JFrame("FlowLayoutDemo") {
    public Dimension getMinimumSize() {
    Dimension prefSize = getPreferredSize();
    return new Dimension(100, prefSize.height);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Set up the content pane.
    addComponents(frame.getContentPane());
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    for example can you Click this.....
    http://www.eclipse.org/vep/WebContent/docs/testcases/null-layout/null-layout.htm
    Thanks for your time.
    Arjun Palanichamy.
    Chennai-India.

  • Pop Up Text in an applet on mouse over event

    Can anyone help me to design a pop up text message to be displayed in an applet on moving your mouse over a particular control. Plz. Its urgent

    To show a pop-up use javax.swing.Popup. Add a mouse listener to button. When mouse enters the button pop-up shows and when mouse exited the button, pop-up disappears. This pop-up is capable of displaying simple message to any swing component. Sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * @author mrityunjoy_saha
    * @version 1.0
    public class AppletWithPopup extends JApplet {
        private Popup popup;
        private JButton button;
        private JLabel message;
        @Override
        public void init() {
            setLayout(new FlowLayout());
            button = new JButton("Hello");
            message = new JLabel("This is a JLabel. It can be any swing component.");
            button.addMouseListener(new MyMouseListener());
            add(button);
        private class MyMouseListener extends MouseAdapter {
            @Override
            public void mouseEntered(MouseEvent e) {
                System.out.println("Mouse entered.");
                PopupFactory factory = PopupFactory.getSharedInstance();
                popup = factory.getPopup(AppletWithPopup.this, message, (int) button.getLocationOnScreen().
                        getX() - 20, (int) button.getLocationOnScreen().getY() + 40);
                //popup = factory.getPopup(AppletWithPopup.this, message, 50, 10);
                popup.show();
            @Override
            public void mouseExited(MouseEvent e) {
                System.out.println("Mouse exited.");
                if (popup != null) {
                    popup.hide();
    }If you are talking about alert box (where some message can be displayed), in above example instead of javax.swing.Popup use javax.swing.JOptionPane. In case you are using JOptionPane, make it visible in mouseEntered() method and hide it in mouseExited() method.
    Thanks,
    Mrityunjoy

  • Mouse over labels similar to IE toolbar

    I'd like to have a couple of labels, say B(bold), I(italic) and U(underline), when you put mouse over, it will raise and when you press or click, it will sink, but the label position should remain SAME all the time.
    I have my sample codes below which does this, the only thing that doesn't work is that the label position tends to change. Any ideas or solutions?
    import java.awt.event.*;
    public class Test extends JPanel {
         JLabel b, i, u;
         Test() {
              setLayout( new BorderLayout() );
              JPanel np = new JPanel( );
              JPanel sp = new JPanel( new GridLayout(0,3) );
              b = createLabel("B", "Bold");
              i = createLabel("I","Italic");
              u = createLabel("U", "Underline");
              sp.add( b );
              sp.add( i );
              sp.add( u );
              np.add( sp );
              np.add( new JButton("OK") );
              add( np, BorderLayout.NORTH );
              JTextArea ta = new JTextArea(20,30);
              add( new JScrollPane( ta ), BorderLayout.CENTER );
         JLabel createLabel(String text, String tip) {
              JLabel l = new JLabel( text );
              l.setName("UNCLICKED");
              l.setToolTipText( tip );
              l.setHorizontalAlignment(JLabel.CENTER );
              l.setBorder( BorderFactory.createEmptyBorder(10,10,10,10) );
              l.addMouseListener( new MouseAdapter( ) {
                   public void mouseEntered(MouseEvent e) {
                        JLabel l = (JLabel) e.getSource();
                        if ( "UNCLICKED".equals( l.getName() ) ) {
                             l.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createRaisedBevelBorder(), BorderFactory.createEmptyBorder(10,10,10,10) ) );
                   public void mouseExited( MouseEvent e) {
                        JLabel l = (JLabel) e.getSource();
                        if ( "UNCLICKED".equals( l.getName() ) ) {
                             l.setBorder( BorderFactory.createEmptyBorder(10, 10, 10, 10) );
                   public void mousePressed( MouseEvent e ) {
                        JLabel l = (JLabel) e.getSource();
                        if ( "UNCLICKED".equals( l.getName() ) ) {
                             l.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(10, 10, 10, 10) ) );
                   public void mouseClicked( MouseEvent e ) {
                        JLabel l = (JLabel) e.getSource();
                        System.out.println("clicked with name " + l.getName() );
                        if ( "UNCLICKED".equals( l.getName() ) ) {
                             l.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(10, 10, 10, 10) ) );
                             l.setName("CLICKED");
                        }else {
                             l.setBorder( BorderFactory.createEmptyBorder(10,10,10,10) );
                             l.setName("UNCLICKED");
              return l;
         public static void main(String args[] ) {
              JFrame f = new JFrame();
              f.setContentPane( new Test() );
              f.pack();
              f.setVisible(true);
    }

    I think the text moving because you sometimes use compoundBorder, sometimes use emptyBorder. Those borders have different thickness, and your text is squeezed.
    Maybe you can try make your emptyBorder a little bit thicker, like (12, 12, 12, 12), see whether it can solve the problem.

  • Oracle form 6.0, how to do 3D chart, calender,mouser over changing....

    oracle form 6.0, how to do 3D chart, calender,mouser over changing....in we form, like microsoft style.
    Or it's better use 9i or 10g jdeveloper? or other tchnology?

    The cpu resources are only limited once the cpu's are 100% utilized. It is highly unlikely that dom0 will try to use 100% of a cpu, let alone all cpus. Only when there are no idle physical cpus would you run into issues.
    You may want to try reducing the number of vcpus in the windows guest. I have seen reports from users claiming that having more vcpus in a windows guest causes it to run slower.

  • How to get mouse over shape to display data in Visio 2013?

    Hi Visio pros,
    I am required to create a diagram of our servers rack setup and will be publishing to a Web page using Visio 2013.
    The goal is to mouse over the server shape and have the data be displayed. I have followed arguably every solution on the internet. I am either doing it wrong, or it might be outdated information.
    I'm hoping Paul Herber, or other Visio pros would be able to help me with this situation as I am on a tight schedule and have exhausted my resources.
    Things I have tried:
    user.visEquivTitle in ShapeSheet
    http://visualsignals.typepad.co.uk/vislog/2012/02/no-mouseover-with-visequivtitle.html
    and
    prop.(data name) in the comments within the miscellaneous section of the ShapeSheet.

    Hi Sir!
    I am open to the possibility that I may have done something wrong as I am very new to Visio.
    Here are the steps I followed:
    http://visio.mvps.org/ShapeSheet/
    Browser that I am using is Internet Explorer since I ran into problems with Google Chrome.
    However, after more reading I noticed the User.visEquivTitle provides a tooltip. If it is what I think it is, which is a small yellow box displaying a string, my employer would not want that.
    We're looking for something that will provide an aesthetic display of data after mouse over onto the shape.
    Thank you very much for your help.

  • Spry Menu bar mouse-over?

    Hi there,
    I have created a spry menu bar and it's almost finished but I am having trouble with these 2 things:
    1. Only the buttons that have submenus change when the mouse pointer moves over it. This happened when I applied a background image to the buttons.
    2. I don't want the background image to be applied to the submenu items. I want those to have just 1 color and another color when the mouse pointer moves over it. (If this last part isn't possible, I would just like the first part to happen: I want it to have a color and not the background image that I applied)
    Could you please have a look at my CSS and tell me what I did wrong? Or what I should add?
    Thank you very very much.
    EC
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
    padding: 0;
    list-style-type: none;
    font-size: 155%;
    cursor: default;
    width: auto;
    font: "Bell MT";
    margin: 0;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
    z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 90%;
    position: relative;
    text-align: left;
    cursor: pointer;
    width: 204.8px;
    float: left;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 100%;
    z-index: 1020;
    cursor: default;
    width: 204.8px;
    position: absolute;
    left: -1000em;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
    left: auto;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
    width: 204.8px;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
    position: absolute;
    margin: 0 0 0 0;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
    left: auto;
    top: 0;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
    border: 1px solid #151515;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
    display: block;
    cursor: pointer;
    background-color: #EEE;
    padding: 0.5em 2.5em;
    color: #C3C2C2;
    text-decoration: none;
    background-image: url(Skyline/images/Background%20Menu%202.png);
    background-repeat: repeat-x;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
    background-color: #414040;
    color: #C3C2C2;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
    background-color: #414040;
    color: #C3C2C2;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
    background-image: url(Skyline/images/Background%20Menu%202.png);
    background-repeat: repeat-x;
    background-position: 95% 50%;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
    background-repeat: no-repeat;
    background-position: 95% 50%;
    background-color: #414040;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
    background-image: url(SpryAssets/SpryMenuBarDownHover.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
    background-image: url(SpryAssets/SpryMenuBarRightHover.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;

    http://foundationphp.com/tutorials/sprymenu/customize2.php
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Interactive PDF with mouse-overs was created in Illustrator, now pauses and flashes when opened in Acrobat

    I have created an interactive PDF using Illustrator that has mouse-overs. When i export the file and then open it in Acrobat there is odd pausing on teh image bewteen mousing over it and the text callout that shold then display. Did I export or save incorrectly?

    Thank you for both responses! I'm impressed with the fact that you're reading my post.
    I'm new to tech matters with Adobe/PDF/Nitro tho I've been using them for several years.
    The original file was created by an agency and given to independent contractor to use.  I don't know which program they used to create the form. And I don't know what XFA or LiveCycle Designer means  because I'm not technically sophisticated unfortunately.
    I used Nitro 6 to populate the data and have a number of forms already filled out, which I periodically open and modify and resubmit. But Nitro 6 is acting sick, despite reinstalling several times.  I'm attempting to see if it's worth transitioning to Adobe Acrobat, i.e., can I reopen the forms I've populated and continue to work with them.  I like some of the Adobe features for other purposes (e.g., OCR). 
    Any help in determining how to open the form while keeping the data?

  • When i open firefox from my desktop, it won't open as a full page,only a tiny page when i mouse over the firefox icon on my taskbar

    if I open firefox, it doesn't go to my home page, instead my desktop stays up. if I mouse over the firefox icon on the taskbar a tiny homepage pops up but you can't make it bigger.

    This has happened to me many times but on the older FF 3 It could be a small bug, One should list the PC's being used as it could be related? Mine is an E-Machine Mod, W3609 running W7.

  • Mouse over events on alv report?

    Hello,
    i want to make mouse over event for rows of a alv report.When mouse is on a row there will be shown explanations.
    how can i do this?
    thanks inn advance.

    Cem ,
    Please follow the code mentioned in the links below :
    Hotspot in ALV grid
    http://wiki.scn.sap.com/wiki/display/Snippets/Interactive?original_fqdn=wiki.sdn.sap.com
    Thanks
    Ankit

  • I need help identifying and removing annoying gadget that shows all open windows and applications when I mouse over a corner.

    It seemed like a good idea at the time. Some time ago I installed a gadget (doesn't seem to be an item in my Applications folder) which, when I mouse-over the lower-left corner of my screen, brings up a screen showing reduced-size versions of all open application windows and Finder windows. I've tried to identify what it is, and where it is located, so I can remove it, but to no avail.
    I'd really appreciate any help getting rid of this thing. Thanks!

    Hi Paul,
    Check System Preferences>Accounts (Users & Groups in later OSX versions)>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Check the System Preferences>Keyboard>Keyboard Shortcuts.

  • How do you SELECT ALL on a page (used to CTRL L-CLICK in margin then mouse over selection)?

    In Pages 4x you could hold CTRL+LEFTMOUSE while in the margin area then select multiple things on that page you were looking by mousing over them (including selecting all).  Now you have to go one item at a time to delete? Is there a work-around?

    Ghazgkull wrote:
    . ctrl+clicking in iTunes selects all.
    No, it does not. You are still incorrect.
    ctrl + click does NOT select anything.
    It checks all boxes when you ctrl click on one box.
    If you want to select a bunch of consecutive songs...
    Select one then Shift click another, This will select all items from the first selection to the last selection.
    This is just plain nutty and is normally achieved on Windows 7 using ctrl+a,
    No it doesn't
    ctrl + a selects all.
    You are not selecting anything when you check all boxes. You are sinmply checking all boxes.

  • How do you create the 'cream pop-up info text boxes' that appear when you hover mouse over?

    Hi people,
    I really need to know how you create the 'cream pop-up info text boxes' that appear when you hover your mouse over an object on a webpage (and often in any program e.g. Photoshop) for more than a second. I need to know because the logo on my website is the navigation tool used to return to the homepage. It is always found in the top left so the user can always click it to return.
    The only problem is im the only one who knows that when you click my logo, you return to the homepage. I need one of these 'cream info boxes' (forgive my lack of knowledge) to appear so the user will figure it out.
    Thanks for taking the time to read my question...

    Using your code it should look like this where title attribute is in red:
    <div id="apDiv2"><a href="index.html"><img src="divs_dw/jtgd_logo_trans.png" alt="jtgd_logo" title="your description goes here" width="176" height="163" /></a></div>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • Why does moving the mouse over an IMAQ image display slow the GUI down so much?

    I have a large application with several vi's running simultaneously under labview 8.6.1.  When I mouse over an image display control in one of the vi's, everything slows down a shocking amount in all the other vi's.  The windows task manager does not show a large increase in CPU use.  My pc is has a quad cpu with 4GB of RAM, and the CPU and memory loads do not appear to be terribly taxing to the system.  However, many of my vi's apparently come almost to a standstill if I just move the mouse in a circle around my image control.
    This looks like it is largely a GUI display issue.  If I make a new vi and put a while loop in it that only displays the iteration loop number to an indicator, I can see the iterating occurring, then stopping totally when I mouse inside the image display control.  When I stop moving the mouse inside the control, or when I move it outside the control, the interation loop number jumps up, as if it had been incrementing behind the scenes the whole time.  So only display of the interating was halted.
    This problem occurs even if the vi with the image control is not executing.  If the vi with the image control is open but not running, and I mouse over the image on it, the other guis all come to a screeching halt.
    Does mousing in the image display control really utterly crush all other guis in all other labview windows?  Is this an issue inherent to the image display control?  If so, is there anything I can do about this? 
    Also, this issue is not entirely limited to display.  I started looking at it in greater detail because this issue also exposed what I think is a race condition in my code.  I have a vi that acquires an image from a ccd and puts it into an IMAQ image.ctl.  This image then gets passed up to a vi up the call chain, and is put on a queue and sent over to be de-queued by a vi that has the image display control.  Here's the kicker:  when I mouse over the image display control, the image successfully gets acquired inside the subvi, and if I probe the wire leading to the output IMAQ image display.ctl, I see the image.  If I simultaneously probe the wire coming out of the subvi one level up the call chain, the image gets lost about half the time.  This only happens if I am mousing in the image display control IN A TOTALLY DIFFERENT AND SEPARATE VI.  If I bump up the priority of the ccd image acquisition vi to 'highest priority', the problem only happens about 1% of the time, and I really have to mouse around to make it happen.  Still, it's disturbing that mousing in the GUI in one window results in a failure of a separate subvi to simply pass an image up the call chain.  I understand that IMAQ images are referenced rather than passed by value, but I don't see why there should be a failure to pass the image up the call chain.  I've looked for a race condition, but can't find one.
    Eric

    I have finally been able to replicate the behavior that you are seeing on another computer once the image was large enough.  Here are a few notes about this behavior:
    First. The UI only slows down when the images are large, 16 bit images.  The reason why this is unique to 16 bit images is that they can only be displayed on the front panel as 8 bit images.  The workaround that Weiyuan suggested to change the 16 bit display mapping hints towards the root of the problem...that any time a mouse runs over the indicator, Windows asks the entire image to re-draw (having a separate indicator overlapping the image will create the same behavior).  With a 16 bit image, not only does the image have to re-draw on the screen but the 16 bit pixels need to be mapped to 8 bits.  When setting the 16 bit display mapping to Full Dynamic, this requires mor computation/pixel than 90% dynamic or one of the other mapping schemes.
    This is expected behavior if your program is running and you're trying to display a large 16 bit image.  To fix this behavior there are a couple options:
    Change the 16 bit display mapping to something other than full dynamic.  You can choose which 8 bits to display or if you want to map the bits. 
    Resize the image just for viewing purposes on your front panel (since you aren't going to view every single pixel of you image on the screen). You can use the IMAQ Resample.vi to do this.  This will allow you to take your 1500x1500 pixel image and only display a 500x500 pixel version.
    If you are interested in viewing small details of the large image, consider just displaying a smaller region of interest at a time.
    Let me know if any of these solutions work for you.  Good luck on your application.
    Zach C.
    Field Engineer
    Greater Los Angeles

  • One more nugget: Chart zoom with the "Mouse Over" effect

    Hello all.
    Just read my signature first, it might explain a lot. I do not intend to compete with Darren and I don't think this "nugget" (at least it supposed to be one) will amaze any of the LV veterans and this forum is rich of them. But maybe it will bring some new ideas to some of you or maybe it will be useful for some LV beginners (like me). It is very likely, my code will have some lapses, but please be gentle pointing that out to me. If you feel a need, you can always optimize the code and develope it further. Just don't forget to share!
    So back to the point.
    I am developing a project using LV. In my program there is a waveform chart which has to show 4 plots. Depending on the length of the X Scale, it sometimes gets hard to see the plots clearly because of their density.So I decided that I need a tool, which would zoom the chart in. And this is what I have came up with after a few "Google" searches to check which part of the bike is already invented and also a bit of programming by myself. 
    Maybe you guys (at least the veterans) know the BetterVIEW Consulting LV example where they have implemented the Mouse Over effect. So a part of their example has been used in this tool and part of the credit must go to them. I thank them a lot
    This tool uses a cluster and its property of visibility to show/hide the cluster depending on if the current position of the mouse cursor is in the desired range or not. The program also gets the image of the chart and returns the subset of the image. The subset is taken for the area arounf the mouse cursor. So if you move the mouse, the zoomed in area will also chage in response. After that, the subset of the image is zoomed in for better view. 
    The user might chage the zoom factor during the execution. Also it is possible to turn the zoom option On or Off if you don't wish to see it for the moment. 
    This is how the front panel looks like:
    And this is the image of the block diagram (see the attached files for the vi, the VI Snippet tool distorts the code too much, so I haven't added it):
    I haven't found anything the same in the forum. Yet I'm a newbie here and I don't have that much experience surfing it. If it wouldn't be something new (in the forum, not necessarily to some of you personally), just ignore the thread. I hope this was worth your time and your attention. 
    Good coding
    Message Edited by Giedrius.S on 02-11-2010 12:46 PM
    While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that...
    Chart zoom with "Mouse Over" effect
    Attachments:
    Zoom.vi ‏198 KB
    Mouse_pos.vi ‏20 KB
    Check_pos.vi ‏18 KB

    Very nice Giedrius.
    It takes guts to "step up to the chalk board" so I will do what i can to give you some ideas to think about. This is similar to the type of feedback I offer durring our in-house code reviews.
    1) The floating property nodes outside the loop are not sequenced by wires so they could execute after the loop starts. Sometimes this could cause weird errors. Seq with the error cluster.
    2) Property nodes can be re-sized so you can apply more than one property setting in the same call. Property node have to execute in the UI thread (which is single threaded) so using a single nodes will force a single context switch rather than one for each.
    3) Setting the same property repeatedly in a loop just burns CPU. THe Scale min for both X an Y can be moved outside the loop ?
    4) THe Wait Until Next ms" function does not get used in any of my code. It is not a way to get a fixed wait but rather a random wait. If you code completes 1 ms after the next multiple, the delay is double less 1 ms. If you have multiple loops using them and it f the delay for each are not unique prime numbers, then the "Wait until next ms multiple" is a good (cough cough) way of getting them all to wake up at the same time and fight for the CPU.
    5)An Event Struture to monitor mouse enter/leave and mouse move (this would have to be a sepearte loop) is easier on the CPU than polling.
    6) Is that math in the case to handle the Chart position on the FP? If so then using the property nodes for the chart to find its postion will let you code adapt to GUI changes.
    7) Right to left wires are not well recieved.
    8) A Bundle by Name is prefered over a "Bundle" since it is self documenting. I know the Picture function so I can see that is the rectangle you are specifying but reader not famliar with that function would not be able to "READ" the code without poking at it.
    9) THe event structure would also help with setting the Zoom factor. Only poke it when you have to.
    That is all that comes to mind at the moment.
    Again thank you!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Prob with jsp setProperty

    Dear fouramites, I am using jsp SetProperty standadr action tag to set from values to beans. In update when I am changing any form field value it is working fine but when I am deleting the form field value the previous value is being set to bean. Wha

  • OSxMavericks Mini Display Port Won't Return to Original Display Settings When Unplugged

    I have a new MacBook Pro 13" Retina Display and display the screen on my Samsung TV. I have never had any problems with the display adjusting from the Samsung output back to the laptop settings when unplugged (on my old MacBook Air), but with OSxMave

  • No puedo importar archivos RAW en LR 4.4 de una Nikon D610

    Hola: Adquirí Lightroom 4.4 y lo he usado bastante tiempo sin problemas con los archivos RAW (Nef) de una Nikon D80. Ahora he comprado una Nikon D610 y no puedo importar en LR los archivos RAW, me dice que no los reconoce. ¿Qué puedo hacer?.  No soy

  • Online security threats

    Is macbook pro prone to security threat? like to virus and malware

  • Infinity Week One... 1Mbps... Helpdesk Woes!

    Hi All 7 days in to my Infinity experience hasn't been great. Some of my latest tests on the http://www.speedtester.bt.com/beta/ site have been consistently low and on several occasions down to 1Mbps. I have even had tests come back at 0.86Mbps! I am