Why differences in the way different machines handle the same code??

OK, I've posted some other threads re some difficulties in getting the same code to function identically on, not only different platforms, but even on different machines running Windows!
Here's another, and I would really appreciate an explanation:
I have a tree control. Per the user's request, I made the right button function the same way it does on MS File Explorer: When they right click, the currently selected nodes are compared to the node they clicked over. If they clicked over a selected node, then the context menu for the nodes selected is displayed. If they clicked over a different node, then the selection is changed to the new node and the context menu displayed. If they right click over the tree control, but not a node in the tree, then the selection is cleared and no context menu is displayed.
Works great on my machine.
However, on some machines, no context menu is displayed, nor is the node selected... UNLESS THEY ALREADY HAVE A NODE SELECTED. I.e., if they have no nodes in the tree selected, they cannot display the context menu by right clicking on a node, nor does the selection change to the node they right click over. It only works if they already have something selected.
My app is distributed as an executable jar file and I am distributing the JRE with it, so there are no class path issues or differences in the JDK. Basically, my problem can be paraphrased as: Why doesnt' Swing behave the same way on different machines...? At least why not the same on the eame machine.
It's driving me nuts to think that I've resolved some UI glitch only to find out that, no, it's only fixed on some machines, not others.
Thanks.

Well, I normally develop on OSX and then deploy to Windows. But, this last build I have switched to Windows XP. The kinds of differences I am seeing are subtle: what triggers a repaint of the UI and now, it seems, what events are getting triggered by mouse clicks.
My deployment is an executable jar file, therefore it uses the manifest in the jar, not any classpath variables. I deploy an entire JRE along with the app, and the bat file that launches the app ensures that is the JAVA_HOME I'm using.
I can only guess that it's some underlying difference in versions of the platform and OS that causes this.
Here's the entire code for this latest issue re the popups:
        private void maybeShowPopup(NodeInfoTree tree, MouseEvent e) {
            if (e.isPopupTrigger()) {
                //  They clicked the platform dependent popup trigger...
                int x = e.getX();
                int y = e.getY();
                TreePath[] selectedPaths = tree.getSelectionPaths();
                if (selectedPaths == null) {
                    selectedPaths = new TreePath[0];
                TreePath clickedPath = tree.getPathForLocation(x,y);
                if (clickedPath == null) {
                    //  they right clicked, but not on a node, so clear the selection and return
                    tree.clearSelection();
                    return;
                } else {
                    // They clicked on a path, so let's see if it is a selected
                    // node.  Search the selected array of paths, short circuiting
                    // out if it is found...
                    boolean foundInSelection = false;
                    for (int i=0; (!foundInSelection && (i < selectedPaths.length)); i++) {
                        foundInSelection = clickedPath.equals(selectedPaths);
if (!foundInSelection) {
// They right clicked elsewhere than the selection, so
// reset the selection to the new path...
tree.setSelectionPath(clickedPath);
final TreePath menuPath;
selectedPaths = tree.getSelectionPaths();
if (selectedPaths == null) {
return;
} else {
menuPath = selectedPaths[selectedPaths.length-1];
// Since they did click on a node, now we need to determine
// what popup menu should be displayed...
tree.scrollPathToVisible(menuPath);
NodeInfo ni = (NodeInfo) menuPath.getLastPathComponent();
// If the last path component is null, then they don't have
// anything selected, so we do nothing
if (ni == null) return;
// See if the Node is overriding our default popup menu...
com.harcourt.applications.tgen.browser.nodes.NodeMenu nodeMenu = ni.getMenu();
nodeMenu.activate(tree.getView(),ni);
JPopupMenu popup = (JPopupMenu) nodeMenu;
if (popup != null) {
popup.show(e.getComponent(),
e.getX(), e.getY());
The nodeMenu.activate call is just used to check whether or not certain menu options need to be enabled or disabled before displaying the menu. My theory right now is that, on some of these machines (all windows), a right click of the mouse is not generating a mouse event unless they have already something selected. I don't think it's a focus issue, because if they left click to select a node, and then ctrl-left click to de-select it, the right button then no longer generates a popup menu. They must select a node, then right click. Maybe there's no mouse event generated, or maybe this line is failing on some machines?:
TreePath clickedPath = tree.getPathForLocation(x,y);

Similar Messages

  • What is the difference between the sports edition apple watch and the normal edition, is it the bands different or do the they have different apps. Also could you take the bands off and put new ones on(change the bands)?

    what is the difference between the sports edition apple watch and the normal edition, is it the bands different or do the they have different apps. Also could you take the bands off and put new ones on(change the bands)?

    what is the difference between the sports edition apple watch and the normal edition, is it the bands different or do the they have different apps. Also could you take the bands off and put new ones on(change the bands)?

  • Why am I getting two different conversations when the same person txts me and sends me an I message? I thought they should be in the same conversation?

    Why am I getting two different conversations when the same person txts me and sends me an I message? I thought they should be in the same conversation?

    I'm experiencing something similar. My conversations are kept together but if the screen is opened to a conversation and I receive a text from that person it doesn't show up on the screen. The message alert in the upper corner indicates a new text but I have to back out of the screen and go back in to read it.

  • My phone is not working the way it did before the manditory iOS 7 update.

    My phone is not working the way it did before the manditory iOS 7 update.  It freezes, it lags, I get kicked out of my apps, my messages do not send half of the time, I can't view the pictures in my camera roll if I enlarge them, and the phone glitches randomly.  How can this be fixed or what do I need to do to get it replaced??

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset   >  http://support.apple.com/kb/ht1430
    Restoring  >  http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • I once created an account and changed meanwhile my Apple ID. Now, when trying to log in to iCloud, I get the message: "You are already logged in". I cannot get access to the account in the way, that, for example, the options appear on the right hand side.

    I once created an account and changed meanwhile my Apple ID. Now, when trying to log in to iCloud, I get the message: "You are already logged in". I cannot get access to the account in the way, that, for example, the options appear on the right hand side.
    What can I do?

    Thank you, pvonk, but:
    To be more precise: I am talking about the logging-in within the System Preferences on my iMac.
    When trying to log in with the old ID, I get no access, i.e. it says "Try again"...-Trying the same with the new one gives me the result I mentioned in my first question...
    Now I found out how to do it: I had to erase all accounts-then I could sign in with my Apple-ID. Thanks again.

  • How do I change the way things sound like the bas, troule

    How do I change the way things sound like the bass, trouble,etc

    What is your operating system?
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Bought a new monitor.. wide screen 23"... Firefox is not filling the full window. IE works fine but I prefer Firefox. What do I need to do to fill entire window, not just the way it was with the old monitor?

    Bought a new monitor.. wide screen 23"... Firefox is not filling the full window. IE works fine but I prefer Firefox. What do I need to do to fill entire window, not just the way it was with the old monitor? edit

    Most pages are defined to be a certain size, regardless of how large or small your monitor is. You can use Firefox's zoom feature (View menu) to enlarge the text and images (or just the text, if you prefer) on a page.
    In addition to making individual site adjustments, there are some add-ons that will default every site to a higher zoom level. For example, check out:
    * [https://addons.mozilla.org/en-US/firefox/addon/6965/ Default FullZoom Level]
    * [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint]
    Does that help?

  • I hear that apps are the way to go in the future for launching web sites. Where do I go to find a good app writer? and How difficult is it to merge a website with an app application. My website will be written in microsoft.

    I hear that having an app for my future website is the way to go in the future. It will help to even the playing field for small business such as mine.THere will great ways to feel out the personal preferences of prospective clients. My site will be written in microsoft. It will have a blogg, store, database, and a community forum. What are the pros and cons to having an app. What are the possible expences to expect with building,launching, hosting and maintaining an app compared to advertising on a deskop. I hear PCC and SEO can often add up to over $5000 a month. Hosting will cost at least a couple thousand a year.
    ANy advice will be greatly appreciated.

    Sounds like you really do not understand what you are talking about.  Not trying to be judgemental, but nothing is written in "Microsoft" unless it's a Microsoft Operating System, application, or website.
    Microsoft is a company, not a programming language.
    I would also recommend you do some reasearch on HTML5 so that there is no need to create an app for each platform, but rather have a single site that will run on multiple platforms.
    Maybe look into contracting/hiring a good web designer.

  • My iPad no longer switches screen when i go from holding it horizontal to vertical.  How can I change it back in settings to have the screen look the way I am holding the iPad

    My screen no longer moves with the way I'm holding the iPad.  For example if I'm holding it horizontal the screen is vertical.  Up unitl now the screen has always moved with the way I was holding the ipad.  Is there something in Settings I can do to get this back?

    If you see a lock icon in the upper right corner of the screen - then the screen orientation is locked.
    Try the side switch above the volume rocker first and see if that unlocks the screen. If that doesn't do it, double tap the home button and swipe to the right and look for the lock icon all the way to the left. (IOS 6). For iOS 7, swipe up from the bottom to get to the control center and look for the lock icon in the top row on the right.
    If the screen is unlocked but still will not rotate, reset the iPad.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the button

  • What is the way open if i Forgot lock code to enter

    What is the way open if i Forgot lock code to enter

    You'll have to restore your iPad through iTunes.  First as a new device, then you can synch over your apps, contacts, etc.

  • Why is WB temperature way different than what's set in my camera?

    I did search for the topic before I posted and only one relevant post came up (in the last month) which moreless confirmed the same issue with a different camera.
    I shoot Olympus E1, so I dialed 7500K and fired a shot. Imported into Aperture and looking at WB scale and it reads 6186K. The image looks as if Aperture showed the image correctly, but the number is way off. 1300K difference??? So obviously if I move it to 7500 it will not be correct anymore because it will be rather 8800 in reality.
    Second thing I did right after, was to look at EXIF and sure enough Aperture showed no value in WB field.
    For a comparison purpose I looked at the shot in ACR and found out that the temperature was spot on. So this is not rather whether Olympus is hiding the value so it's difficult to retrieve, but rather how is Aperture coming up with so wrong figure.
    I am also curious how can Aperture get the image colored correctly if it cannot figure out the set WB value in camera properly.
    Puzzling to say the least and confusing possibly for processing work.
    Thanks
    Marek

    Hi Marek,
    There are a couple ways you can get white balance "right."
    1) You can shoot a grey card (or something like an ExpoDisc) in the field and then set the white balance of the camera onsite.
    2) You can shoot the same grey card onsite and leave the camera on AWB, and shoot everything. Then go back and eyedropper the grey card and batch change all your photos.
    #2 is quicker... but they both work equally well.
    But practically you will not "get it right" by setting the white balance to a preset in the field. "Daylight" at 5000K (or whatever the setting in your camera is), is a total WAG. The actual color temperature may be 4500K or 6300K in that setting -- you will have very little chance of getting it right by picking an auto setting. You COULD break out a spectropherometer and measure and find it is 5002K so use 5000K in camera, but again if Aperture came up with 4837 you'll still want to edit later.
    If you are "serious about your shooting" where "serious" means accurate, then you are going to be shooting indoors under controlled lighting conditions. You will also shoot with a full GMB card which has all the colors and tints and hues, so you can get absolutely correct colors (HELLO, FASHION AND ADVERTISING PHOTOGRAPHY). If you do landscape, then color temperature, as is contrast and a number of other things, is open to interpretation. When I was shooting with Seth Resnick in Antarctica a few weeks back, his rule of thumb was basically "Start at 6500K and warm it up from there." lol. Still, his images are beautiful.

  • Can I have different folder subscriptions on different machines to the same imap account?

    I have several email account that 2 of us use for various things, usually on different computers. I set up server end filters to sort some incoming emails into seperate folders. For example NewFolder1 & Newfolder2
    I would like one machine to subscribe to the Inbox, Deleted, Sent, Drafts and say NewFolder1, and the other machine to subscribe to Inbox, Deleted, Sent, Drafts and say NewFolder2
    Whenever I unsubscribe from say NewFolder1 from one machine it unsubscribes from both machines.
    Seems a bit pointless to have to download all the messages, I would be better off forgetting the Server end filters and do the sorting at this end with individual filters on each machine.
    However, if one machine is not on or not reading email, then my Inbox is filled with unnecessary messages
    until the other machine downloads them and filters them.
    I guess what i need to know is whether the "subscription list" held locally or at the server end and is itself "subscribed" (kept synced by the imap server on both machines)?

    The problem using TB filtering that all the messages could be downloaded to both machines.One local machine would have filters for some messages but until that machine downloads them & filters them they will be downloaded on the other machine if it were on.
    Sure I could just down load the headers and wait each time I want to read a message on that machine. I could also download everything and just make some folders "invisible" but that sort of thing defeats the purpose & usefulness of IMAP.
    I came across a forum where someone was having problems with TB & Microsoft Server. That problem was that TB would "self subscribe" to folders on the server, even ones that had been deleted on the server end, then throw an error message when TB tried to operate on the deleted folder. No other email program would behave like this.
    This suggest that some sort of "subscription list" for TB was being kept on the Server and kept "synced" with TB, almost like being (subscribed to the list).
    There seems little information out there on how subscription physically works (the nuts & bolts)
    Most of it seems to be "how to configure xxxx for IMAP" .
    I guess Its hard to know what to even search for because TB has become so big & cumbersome that only the programmers know what/how various bits works and since they already know, it doesn't occur to them that users may not know.

  • JDBC connection to two different machines from the same program

    I want to use JDBC to connect to two different databases that are on two different MySQL installations on two different machines.
    One of the installations is MySQL 4.1.12 and the other is 4.1.14-nt
    For some reason, all my statements seem to be going only to one machine, even though I am very clearly set it up to go to two different machines.
    Does anyone know whether connecting to two different installations from one program presents any unusual problems?
    Thanks.

    Unless there is some horrible defect in the MySQL JDBC driver (which I doubt!), there should be no problem and like the other poster says, please post snippits of your code so we can see what your doing...

  • I need help using the impdb utility on a different machine to the export...

    Hi all,
    I have recieved an export from a ClearQuest database, built on Oracle.
    It's a 6GB file xxx_full_dpdump.dmp, with a corresponding .log.
    This was exported from a different Oracle instance on a different machine.
    I'd like to import this dump file into my Oracle instance.
    I tried to use imp, and received the following error: IMP-00010: not a valid export file, header
    After a bit of reading, I think this may becase I should be using impdp.
    BUT... when trying to use impdp, I'm not sure how to structure the syntax? specifically, what is DIRECTORY?
    As this is export is from a different machine, the directory that it was exported to is not on my machine.
    When running ...
    impdp username/password directory=MyDirectoryThatContainsTheDmp DUMPFILE=xxx_full_dpdump.dmp
    ... I receive:
    ORA-39002: invalid operation
    ORA-3970: Unable to open the log file
    ORA-3907: directory name MyDirectoryThatContainsTheDpm is invalid

    Thanks, I'm using Windows XP SP3 and Oracle 11g (11.2.0.1.0)
    So I've now granted the right permissions, it seems and The Impdp now executes (Hoorar!)
    The command I'm running is:
    impdp username/password directory=DATA_PUMP_DIR dumpfile=xxx_full_dpdump.dmp REMAP_SCHEMA=MYUSER:Test;
    ... where MYSUER is who I'm logged in as running this command; and Test is just a word, I haven't created anything called this myself.
    BUT ... I get a few thousand errors around
    - Cannot add file ... file has an Oracle Managed Files file name
    - CREATE USer ..... failed tablespace XXX does not exist
    - lots of "already exists" errors for users and tables.
    Any ideas what I'm doing wrong? I though these would all be created as new items under MYUSER.
    Thanks so much!

  • New Mac on the way - Time Machine questions

    Hi there,
    My new Mac is now on its way from Apple and I just have a couple of questions regarding Time Machine:
    1. My new Mac is a MacBook Pro with retina display which is going to replace an early 2006 Intel iMac running Snow Leopard. I was hoping to use my latest Time Machine backup external hard disk to transfer the data using Setup Assistant as the USB port is the only common connection between the two Macs (other than WiFi which I suspect will be a bit slow when used with Setup Assistant). Will Time Machine use the lastest incremental backup to populate the new Mac, or will it only look to the last full backup (I am only looking to import my user settings, iTunes music and iPhotos)?
    2. Going forward, I'm trying to move to a more wireless setup. Previously my iMac used Time Machine on an external USB disk drive, however, I now want to use something like the Western Digital My Book Live connected to my wireless router via ethernet. From searching on the web, it seems this can be a bit hit and miss with both data transfer speed and reliability. I was therefore wondering if any of you guys have had any experience with using an external ethernet hard drive via a wireless router for use with Time Machine, and if so, whether you are able to recommend a particular model. My wireless router is a D-Link DSL-2740R which is ADSL2/2+ and 802.11n compatible.
    3. If I do go down the route of the external ethernet hard drive, would it be best to purchase the Thunderbolt to Gigabit Ethernet cable for the initial backup, as I suspect the first full backup would take a while over WiFi.
    4. If there are issues with using a network drive, I guess the only other option is to use a Thunderbolt or USB 3.0 drive and then manually force Time Machine to back up when I am at home and can connect the drive (which could mean a while between backups). Unless anyone can offer any other solutions.
    Many thanks for any help you can offer. 
    Steve

    Use the Migration Assistant. Their are specific files not in the application folder that contain preferences and the like. The Migration Assistant will move over those preferences as well as the applications themselves. Plus it takes WAY less time.

Maybe you are looking for