JTree odd click behavior w/ L&F

I have a JTree that works perfectly until I change the L&F. In the mouse down event, once the line of code executes:
UIManager.setLookAndFeel("string");
SwingUtilities.updateComponentTreeUI(root);
(root is the entire JFrame where the tree and the other components lie)
Before this is executed, the tree "leaves" require one click to run my code -- basically updating a JLabel with the current path. This is trapped on the mouse down event.
Afterwards, however, the tree needs 2 clicks before it'll register the current node.
Do I have to update something in the JTree when the L&F are changed?
Thanks --
Steve

Seems like the JTree selection path is the only thing not updating correctly...
This code:
tree.getSelectionPath()
seems to be returning the path right before it -- unless you double click.
Is this a Swing bug?

Similar Messages

  • Odd display behavior

    Happy New Year to All!
    I just recently upgraded to Tiger. Since that time, I have noticed some rather odd display behavior on my screen. For example, when I am on web site that has a "fill-in" box, once I highlight that box to fill it in, a black rectangle stays in that position on my screen until I click on the desktop.
    Likewise, if I highlight an icon on the desktop, a black rectangle outlines the icon and stays visible until I either highlight something else or click randomly on the screen.
    I never noticed this behavior under Panther (10.3.9) and while it's not a huge deal, it does seem odd. It's as if the screen doesn't refresh after moving on. Any ideas?
    Thanks,
    Brad
    P.S. After posting this message, a black rectangle corresponding to the message edit box stayed on my screen. Irritating.

    Hi William,
    Yes, I tried both and booted / used my Tech Tool Deluxe repair disk. All no help. Don't know if they are related, but also have other odd things going on.
    Is it normal to have two Restart selections, two Shutdown selections and two Logout Selections under the Apple menu in Tiger? I do. Didn't in Panther, but can't remember if I've always had them in Tiger. Should I?
    Also, can't get my scanner (All-in-one, printer works) to run in Tiger. All of these problems go away when I boot into my 10.3.9 clone on my Firewire drive. I'd really hate to return to Panther, but ...
    Basically, I'm getting some very odd behavior, from a system that has always been relatively bullit-proof until now. I do all the req'd housekeeping stuff, have both Macaroni and Cocktail. Don't know what to try.
    Brad

  • I had my iphone 5 replaced at the apple store as of a broken sleep button and i was wondering if they would replace again as i think it may of happend again as it works most of the time but theres an odd click where it wont work.

    I had my iphone 5 replaced at the apple store as of a broken sleep button and i was wondering if they would replace again as i think it may of happend again as it works most of the time but theres an odd click where it wont work.

    Yes.

  • How to override Ctrl-Click behavior in Java L&F

    On the Mac, Ctrl-Click is the popup trigger. While Java L&F designers were obviously aware of this (it is warned about in the Java Look and Feel Design Guidelines, 2nd ed, page 106). However, just two pages later (page 108), they then generically specifify that Ctrl-Click is used in lists and tables to toggle the selection.
    The implementation of the Java L&F does not appear to consider the Mac's use of Ctrl-Click and still toggles selection. If there is an additional mouse listener that shows a menu in response to the popup trigger, it will ALSO open the menu on Ctrl-Click.
    What is the best way to overide the Ctrl-Click behavior in JTable etc. to NOT do the toggle selection? Note that this is a mouse event and not a key event, so it can't be turned off or changed by the getActionMap() mechanism.
    Also, does anyone know what the "Command" modifier on the Mac (Command-Click is supposed to toggle selection on Macs) shows up as in the InputEvent (isMetaDown(), isAltGraphDown()...)?

    Try extending the JList and override the processMouseEvent(MouseEvent evt) method and show your popup menu when the user clicks the mouse while holding the CTRL key down. The code below demonstrates the same.
    import java.awt.BorderLayout;
    import java.awt.event.MouseEvent;
    import java.util.Vector;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.ListModel;
    import javax.swing.WindowConstants;
    public class Temp extends JFrame {
         public Temp() {
              super("Temp");
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              String [] items = {"One", "Two", "Three", "Four", "Five"};
              JList list = new MyList(items);
              JScrollPane scroller = new JScrollPane(list);
              getContentPane().add(scroller, BorderLayout.CENTER);
              pack();
              setVisible(true);
         class MyList extends JList {
              public MyList() {
                   super();
              public MyList(Object[] listData) {
                   super(listData);
              public MyList(Vector listData) {
                   super(listData);
              public MyList(ListModel dataModel) {
                   super(dataModel);
              protected void processMouseEvent(MouseEvent evt) {
                   System.out.println(evt.isPopupTrigger());
                   int onmask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
                   if(evt.getModifiersEx() == onmask) {
                        JOptionPane.showMessageDialog(this, "Control + click");
                   else {
                        super.processMouseEvent(evt);
         public static void main(String[] args) {
              new Temp();
    }Hope this helps
    Sai Pullabhotla

  • Odd clicking sound on iMac

    HI
    My Imac has started to make an odd clicking sound which comes and goes.  Intially it was totally silent so it is a bit disconcerting.  Any ideas.The machine is just about a year old.
    Thanks

    Before you do ANYTHING, backup your system. REPEAT BACKUP YOUR SYSTEM NOW!!!!!!!!!!!!!!!!!
    Then listen to the sounds in Failing hard drive sounds and see if your sound is like any of these, if it is take the system in for a new HD. DO THIS AFTER BACKING UP THE SYSTEM!!!!!!!!

  • Random freezing and odd keyboard behaviors on 10.5.8

    My random freezing started on 10.5.6. Updated to 10.5.7 and the problem persist. I have decided to upgrade to 10.5.8. Everything seemed fine for a day and a half. Then all of a sudden random freezing when starting, login, wake from sleep, etc.. and now odd keyboard behaviors. function keys randomly work when computer is not frozen.
    I have tried every option listed in the discussions here and elsewhere. Does anyone have the same problems?

    I have tried so far:
    disk permissions repaired from dvd and startup,
    disk first aid,cleaned caches, virus checked, zapped the pram, reset power management, ran apple hardware check, ran disk warrior, trashed network prefs, deleted sleep image, replaced directory with techtool pro, tried new user account, re-updated, removed 3rd party software, and nothing works?????

  • Change click behavior BAL_DSP_LOG_DISPLAY

    Hello! I have an requirement that is calling FB03 from a double click on an aplication log.
    I'm using FM BAL_DSP_LOG_DISPLAY to show the required logs. So far so good.
    The problem is changing the default behavior on the double click of a message (showing a popup with the message details). I need to call FB03 when a specific message type and number message is clicked.
    Is it possible to override the default click behavior on BAL_DSP_LOG_DISPLAY? If possible, how do I do this?
    Thanks in advance, best regards.
    Edited by: djutopic on Feb 17, 2011 11:53 AM

    Actually, the click behavior haven't been changed. I added a detail callback function to the message.
    In the specific message that needed a special behavior I populated the field params of the message with the program and routine that will handle the click.
    Something like:
    data: l_s_msg       type bal_s_msg,
             lw_callback type bal_s_clbk,
             lw_param    type bal_s_parm.
    lw_callback-userexitt = ' '.
    lw_callback-userexitp = <PROGRAM_NAME>.
    lw_callback-userexitf = 'MESSAGE_TO_FB03'.
    lw_param-callback = lw_callback.
    l_s_msg-params = lw_param.
    The routine looks like this:
    form message_to_fb03 tables pt_params structure spar.
      data: lv_belnr type belnr_d,
               lv_gjahr type gjahr.
      read table pt_params with key param = 'V1'.
      lv_belnr = pt_params-value.
      read table pt_params with key param = 'V2'.
      lv_gjahr = pt_params-value.
      set parameter id: 'BLN' field lv_belnr,
                        'BUK' field '0100',
                        'GJR' field lv_gjahr.
      call transaction 'FB03' and skip first screen.
    endform.
    Regards

  • Get node jtree without click

    hi all,
    I want get node from jtree without click, just with mouse in node.
    I look in google but dont find nothing...
    I try use listener but MousePressed dont help-me.
    thanks

    jTree1 = new JTree1(treeModel);Sorry, now
    jTree1 = new JTree(treeModel);
    MouseMotionListener mm = new MouseMotionListener(){
          public void mouseMoved(MouseEvent e) {
                System.out.println("moved "+e.getX()+" "+e.getY());
                 int selRow = jTree1.getRowForLocation(e.getX(), e.getY());
                TreePath selPath = jTree1.getPathForLocation(e.getX(), e.getY());
                if(selRow != -1) {
                                    System.out.println("mouse moved..."+selPath);
        public void mouseDragged(MouseEvent e) {
                   System.out.println("dragged "+e.getX()+" "+e.getY());
    jTree1.addMouseMotionListener(mm);
    jScrollPane1.setViewportView(jTree1);

  • Multiple Problems: iTunes does not recognize, no music, and odd click

    I went to update my iPod, and after I updated it, I went to go listen to it, and it said I had no music, no videos, no photos, nothing! But if I look at the summary of the iPod, it says there is still stuff on it, however it is now orange instead of blue, before it was blue, because of all the music.
    It is also making an odd clicking noise now.
    Also, iTunes does not recognize my iPod. I have attempted the 5 Rs, but I cannot restore, because my iTunes does not recognize my iPod, and I attempted the steps suggested if iTunes does not recognize the iPod, and still no luck.
    PUH PUH PUH PLEEEASE HELP!!

    i think im having the same problem, and its bull. i cant find any answers, just this 5 R stuff that definitely solves nothing. First i would plug in my ipod classic into my computer and a message would pop up saying that something has malfunctioned and i need to hook up my device to a 2.0 usb port, even though thats what it was plugged in to, so i reinstalled the drivers for the usb ports. that stoppped happening and now when i plug it in nothing happens, it turns on my ipod but itunes doesnt see it and neither does my computer! HELP!!!

  • Odd usage behavior

    iPhone v101: this odd usage behavior just started half a week ago. This is the second time it happened. During standby, the usage time continues to count forward. I leave my phone on my desk not using it, but the usage still goes up. For example, the usage was 1 hour and 20 minutes when I checked like three hours ago, now it says 4 hours and some minutes. WiFi off, not running any apps, great signal and I cannot find anything running. This behavior also appear to drain the battery a little bit. The phone was not being charged or on plugged in anywhere; just sitting still on my desk. Now, the usage is back to normal and not accumulating time when I am not using it. This is strange. Have anyone else seem this happening? I had the phone for over a month now...

    I didn't notice it causing any battery drain, but it sounds like I am charging it differently than you are. Here's how mine worked:
    I would plug the iPhone into the wall charger at night to charge while I slept. In the morning, it would show a full charge by showing a plug on the small battery icon, but the large green battery would still have a sliver that wasn't green. The usage and standby stats would show something in the 3-4 hour range, presumably the time since it hit full charge.
    I would disconnect the phone, check my email, and then take it to my desktop computer and plug it in to sync and update all my podcasts, etc. I would leave it plugged into my desktop while I showered while I got ready for work. By the time I was ready to leave, it would again show a full charge on the small icon, but now my stats would be reset to 0 and would function normally throughout the day. But nothing I did ever stopped the stats from running up during the night after attaining full charge.
    1.0.1 got rid of the stats problem (they always stay at 0/0 in the morning with a full charge until I unplug the phone) AND the weird behavior of the large green battery indicator went away. Now both indicators show full charge in the morning.

  • Odd Playlist Behavior

    Greetings,
    I have been observing some odd behavior from my iTunes purchased playlist. One day it had completely reorganized itself. I checked, and I had selected it to be organized by number, basically the order I downloaded them in. So I don't have the wrong organization selected (like order by album or artist). Also, sometimes when I play a song it immediately moves to the bottom of the play list, it makes no sense! Any suggestions?

    Sounds like you might have it sorted by either date added or Last Played date. Make sure that you click on the column header that you want to sort on.

  • How can I change/hack double-click behavior to include a preceding dollar symbol in the selection?

    99.999% of times I double-click a word preceded of a $ (dollar) symbol, it is a variable name, and I want to COPY it along with the word, so I don't have to re-type it when pasting it.
    Even in preview mode / visual view / when typing into actual text, I can't imagine a scenario where the dollar sign would not be part of the following word.
    Is there any way to make this dumb behavior smarter?
    Hacking into the DW files? Hacking into MacOS files?
    Thanks.

    epub is a specific format that may require another app - I don't know what that would be on 10.5.
    You can get info on the file in Finder (select the file, choose File Menu > Get Info…) the 'Open with' section will allow you to select other apps & you can also change this file & apply it to all files of that kind.
    That should solve your issue, but you still may need an ebook reader.

  • Odd compiler behavior (re: generics)

    Greetings, I am encountering a rather odd compiler generated error/warning with some code. The issue involves using an "independent" generic method of a raw-typed class. That is, the class has a variable T (call it Test<T> and has an instance method that returns ArrayList<String>. The problem: when a raw typed Test is used, the ArrayList returned is also raw. Here is some code to illustrate:
    import java.util.ArrayList;
    class Test<T>{
      ArrayList<String> getChildren(){
        return null;
      static void test1( Test t ){
        ArrayList<String> children = t.getChildren();
    // WARNING:                      ^^^^^^^^^^^^^^^^
    //Test.java:26: warning: [unchecked] unchecked conversion
    //found   : java.util.ArrayList
    //required: java.util.ArrayList<java.lang.String>
      static void test2( Test<?> t ){
        // OK, since we have the type variable set.
        ArrayList<String> children = t.getChildren();
      }If the type variable is specified as anything but raw, then it works fine.
    Is there some explantation for this behavior? My argument: since the return type of getChildren doesn't use the wildcard, why does the type argument of the implicit instance matter? Is this a compiler bug or just a "sharp edge" in the specification (perhaps even reasonable or necessary).
    I know the solution (or workaround). I am just seeking an explanation.
    Thanks,
    - Tim

    I found a bug evaluation (6358084) that was closed as not a bug where
    the evaluator wrote:
    All members, regardless of their dependence of type parameters, are erased.
    So the compiler is correct, the method call is unchecked.
    Still, I am ignorant of the reasoning for independent or fully described types.

  • Odd RV042 behavior can someone help shed some light?

    We have a group of 4 x RV042 routers linking the 3 branch offices back to the head office via VPN site to site tunnels. Also each of the sites has dual ISP connection, one from a cable provider and the other a DSL connection operating in smart link backup mode with tunnels configured for when each wan is active. In the past week one of the branch offices RV042 started failing over to the secondary DSL WAN link when the primary cable ISP WAN IP was expired and was being refreshed.
    The odd behavior starts a few hours after the switch over, the system log reports that the router restarted but with no error reported and it shows the date being December 31 2002 beginning with a System Up message then the firmware message which is at 1.3.12.19 and establishes a connection with the primary WAN at this point I can ping the public IP but I cannot connect to the router nor can the users at the branch browse the web or establish VPN connectivity to the main office. This condition persists until the router is physically powered down and back on at which time it shows the correct date and time and all operations work well for the day. I must note the behavior seems to only occur between 5am - 7am so I want to believe that this behavior is tied to the ISP IP lease cycle, but it only affects one branch office with all offices using identical ISP's, setup and configuration.
    Can someone help make sense of this situation as rebooting the router each day is becoming annoying?

    Hi Garth,
    Thank you for posting. I wish I had a brilliant explanation for you that would immediately solve the problem. Unfortunately I have not seen this before. There is a possibility that the configuration file is corrupt or has been changed inadvertently. I think I would set the router to factory defaults and manually reconfigure it. There is also the option of swapping the router for another. If the other router does the same thing it could point to an environmental issue. If this router does the same thing at the alternate location it could point to either a configuration or hardware issue.

  • Odd Gvim behavior in Fluxbox

    I just started using gvim recently, and while it's a great editor, it has some weird resizing behavior. I'm not quite sure if it is gvim or fluxbox that is responsible, so I was wondering if anybody could help me stop it. Here's what happens:
    I start Gvim and it looks like this. The dimensions of this window are set by fluxbox, previously I resized it to the size I wanted it and selected remember -> dimensions from the rightclick menue of its title bar. Notice where the bottom edge of the window is.
    [URL=http://img236.imageshack.us/my.php?image=200607211843471280x1024scrottp6.png][/URL]
    Then, when I open a newtab(:tabnew), this happens:
    [URL=http://img233.imageshack.us/my.php?image=200607211844081280x1024scrotov2.png][/URL]
    The bottom edge of the window jumps down, so it sits on top of the panel. Then, if I close the tab (:q) this happens:
    [URL=http://img205.imageshack.us/my.php?image=200607211844251280x1024scrotch0.png][/URL]
    It jumps way up! Anybody seen this before?

    thlokey wrote:
    > While dabbling in a site design, I ran into an odd
    CSS-related
    > behavior in IE6 that I've not seen before. An odd space
    is produced
    > between my two DIVs that disappears when I roll over the
    links. To be
    > clear..I do not want the space. Take a look here
    >
    >
    http://www.todlokey.com/dbs
    >
    > And view the CSS
    http://www.todlokey.com/dbs/css/cssDBS_030607.css.
    >
    > Any ideas to save me some time? Thanks.
    Try this:
    #header UL {padding-bottom:1px;}
    Thierry
    Articles and Tutorials:
    http://www.TJKDesign.com/go/?0
    The perfect FAQ page:
    http://www.TJKDesign.com/go/?9
    CSS-P Templates:
    http://www.TJKDesign.com/go/?1
    CSS Tab Menu:
    http://www.TJKDesign.com/go/?3

Maybe you are looking for

  • Problem with ORARRP and Firefox

    We installed ORARRP utility on a pc. If we create an .rrpt file and double click it the orarrp utility captures the request and pops up a dialogue box. So the orarrp utility is successfully installed in the system. If we use Internet Explorer to run

  • ICS Feed from Exchange to ipad not displaying correctly

    Users are connecting their ipads to exchange 2010 shared calendars via an ics feed. Day & week views of calendar items appear to be correct. However, events that, in exchange are marked as "all Day", don't show up as all day events on the ipad, it ju

  • Central Contract release in ME35K

    In SRM a central contract was created and then distributed to SAP ERP ECC 6.0 Backend. In backend system a release strategy exists for the distributed contract. When trying to release this contract with ME35K the contract will not be found. Checking

  • Command+tab suddenly does not scroll through applications

    In fact, command+tab does nothing at all - it doesn't even show the desktop icon. Both of the command buttons and the tab button do work, just not for this purpose. I use command+tab constantly while I work, so this is a pretty big annoyance. Using a

  • Dial up speeds every evening for weeks Tidewater, VA

    My DSL has slowed to dial up speeds beginning around 5 pm and flucuating widely in speed until 11 pm. I tried all the remedies for slow speed as I have done in the past but they have not helped. Any time I've had problems Verizon dsl it has been with