JTree disable turner

Hello,
I'm trying to disable the default turner (the switch that describes wheter the subtree is opened or not). There are functions for disabling nodes (setOpenIcon(null), setClosedIcon(null)) and leafs and changing color but I did'nt find something for disabling or changing the turner in a tree. Does anybody know how I can change the image of the turner or disable it?
Greetings
Rene

How do you change the collapse/expand icon if you have or not the mouse on the icon?? It is like in evolution when you put the mouse on the icon it change and when you leave it it return to the other icon. I have tried with the next icon:
public class myIcon extends JComponent implements Icon{
Image image;
Image imageSelected;
Image imageUnselected;
public myIcon(String selectedIconName, String unselectedIconName) {
imageSelected = ... //I get the icon
imageUnselected = ... //I get the icon
this.image=imageUnselected;
this.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
image=imageSelected;
public void mouseExited(java.awt.event.MouseEvent evt) {
image=imageUnselected;
public int getIconHeight() {
return image.getHeight(null);
public int getIconWidth() {
return image.getWidth(null);
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
//if this.is
g.drawImage(image, x, y, c);
and I add to the main function:
myIcon expandedIcon = new mycon("expandedSelected.png", "expandedUnselected.png");
myIcon collapsedIcon = new myIcon("collapsedSelected.png", "collapsedUnselected.png");
UIManager.put("Tree.expandedIcon", expandedIcon);
UIManager.put("Tree.collapsedIcon", collapsedIcon);
What do I do wrong??
Thank you very much for the help

Similar Messages

  • Disable / Turn off Thumbnail / Icon Preview in Finder?

    Can't find any new/recent posts to solve this issue. I want to disable/turn-off the little icon preview in finder.
    I have to access a lot of images on a server at work. Image files(jpeg, eps, tiff, psd, ai, ect) that are typically 50MB and higher. So you can only imagine the amount of lag I get and the time I waste every time I click on a folder in list view.
    Is there any way to disable it? Just have it show a standard icon file type instead of it loading 100+ 8MB images in little tiny icons?
    I've already tried the View -> Show View Options -> unchecked 'Show icon preview' and applied it as 'Use as default'
    Its turn off for all folders but it is still loading the mini icon preview.
    (I'm on a Mac Pro - Mountain Lion)

    I've tried reinstalling Mavericks and I'm still having this issue. I'm considering wiping my drive and going back to Mountain lion. Qucktime player in Mavericks seems to suck. I'm having several other issues playing back older quictime files. Most play in Quicktime 7 but a lot have no quicklook previews. The sheer volume of prores files I shoot makes this extremely inconvenient for me. How can Apple not support their own Codec????

  • JTree: disable ESCAPE key

    I want to disable the ESCAPE key on the editingComponent of a JTree.
    The following code works fine for disabling the ENTER key, but if I try to do the same
    thing for the ESCAPE key, it doesn't work.
    It seems that the ESCAPE key is defined at another level. Where could this be?
    * DisableEscape.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class DisableEscape extends JFrame {
        public JTree tree;
        public DisableEscape() {
            tree = new JTree();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
            tree.setCellEditor(new UserTreeCellEditor(tree, (DefaultTreeCellRenderer) tree.getCellRenderer()));
            tree.setEditable(true);
            pack();
        public static void main(String[] args) {new DisableEscape().setVisible(true);}
    * UserTreeCellEditor
    class UserTreeCellEditor extends DefaultTreeCellEditor {
        public UserTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
            super(tree, renderer);
        public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
            Component c = super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
            InputMap im = ((JComponent)editingComponent).getInputMap();
            KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
            im.put(enter, "none");//this works
            KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
            im.put(escape, "none");//this does not work
            return c;
    }Edited by: Andre_Uhres on Sep 24, 2007 2:20 PM
    removed irrelevant code

    It seems that you need another InputMap:
    InputMap im = ((JComponent)tree).getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);here is full working example
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public class DisableEscape extends JFrame {
        public JTree tree;
        public DisableEscape() {
            tree = new JTree();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
         UserTreeCellEditor editor = new UserTreeCellEditor(tree, (DefaultTreeCellRenderer) tree.getCellRenderer());
            tree.setCellEditor(editor);
            tree.setEditable(true);
         InputMap im = ((JComponent)tree).getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
         KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
         im.put(escape,"none"); //this works too
            pack();
        public static void main(String[] args) {new DisableEscape().setVisible(true);}
    * UserTreeCellEditor
    class UserTreeCellEditor extends DefaultTreeCellEditor {
        public UserTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
            super(tree, renderer);
        public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
            Component c = super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
            InputMap im = ((JComponent)editingComponent).getInputMap();
            KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
            im.put(enter, "none");//this works
            return c;
    }

  • How do I disable/turn off/deactivate TREX synonyms?

    hello all,
    currently the TREX server is configured with synonyms so that when we do searches, we also see documents with synonym words.
    but i'd like to turn that feature off completely.  we don't want synonyms whatsoever.
    how do i disable that?

    Hi Mike,
    TREX used in which solution?
    Usually, synonyms is only on, if you actively switched it on.
    It is not statndard TREX behavior.
    How to switch it on (and consequently also, how to switch it off by undoing that) is documented on SDN in this paper:
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0d3be0e-0401-0010-b780-ff7e4e103ea0|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0d3be0e-0401-0010-b780-ff7e4e103ea0]
    Or in the SAP Help Portal search for "trex python extensions".
    Best, Karsten

  • How do I disable/turn off/deactivate TREX 6.1 synonyms?

    hello all,
    currently the TREX server is configured with synonyms so that when we do searches, we also see documents with synonym words.
    but i'd like to turn that feature off completely. we don't want synonyms whatsoever.
    how do i disable that?

    Hi Mike,
    In TREX you should be able to do this by de-activating the Topic Map extension and Semantic Search in the extensions.py, see note 700771 which give details on activating/de-activating extensions.
    See also the how-to guide on semantic search, you should be able to find from this what needs to be disabled.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0d3be0e-0401-0010-b780-ff7e4e103ea0
    If you just want to disable 'Related Terms' in the search iview you can do so by unchecking the 'Show Related Terms' parameter of the Search Options Set that is used in your search iview. You will find the name of the Search Options Set used in your iview properties, if none is specified the the default is usually 'UISearch'. See the following help link for more information:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Regards, Lorcan.

  • Disabling turn off option in locked screen

    My iPhone was stolen a while back and turned off immediately when it was taken.  I assume the SIM card was later taken out to eliminate the ability to locate the phone.  Does anyone know if theres a way to disable the ability to turn off your phone from the locked screen?

    There is not.

  • Enabling lock screen on 'find my iPhone' to disable turning it off.

    I have noticed that when you do a remote lock on an iPhone from the 'find my iPhone' app, it does not disable the phone from being turned off; completely making the app useless.  If I lose my phone and someone snatches it, they just need to turn it off and they are home free (while they jailbrake it, or whatever).  There needs to be a way that when 'find my iPhone' is enabled to request the phone to go into an emergency mode that disables use (remote lock) and disables the phone from being turned off.  If anyone knows a way to accomplish please let me know so I can activate this on my daughters phone (we had a scare a couple days ago, but it turned out to be in her locker : )).  Thanks.

    Hello, Zane.
    Thank you for the question.  You may need to place your device into recovery mode and process a restore as new.  Below, I have included and article that will walk you through this process.  Before you process the restore make sure to back up all media. 
    iOS: How to back up
    http://support.apple.com/kb/ht1766
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808
    If you are still experiencing the issue after processing the restore as new, see the article below. 
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Cheers,
    Jason H. 

  • IPhone wi-fi disabled - Turned Grey :(

    need help. iPhone wifi turned grey --- its disabled totally now...last week, i noticed that its happenning intermittently but since saturday...it no longer reverted to the original state. I tried the most help ive seen on the forum to no avail. what should i do now?

    Grayed out WiFi  usually means a hardware failure, and often happens after updating the iOS, which is stressful to the phone and can cause marginal functioning components to fail.
    Try Restoring the phone in iTunes, first using a backup, and then as new, without using a backup.  If restoring as new doesn't fix it, take it to Apple or whoever provides iPhone warranty service in your county
    FYI "hard" reset is a 1980s PC term.  The only way to do a hard reset on an iPhone is to crush it with a sledge hammer.  To reset the phone - press both the home and power buttons for at least 10 seconds until the Apple logo appears.
    <Edited by Host>

  • Is it possible to disable turning off iphone/ipad with the button?

    Is there a way to disable a theft from turning a stolen iphone or ipad off.  Maybe make it require a password to turn off, is this possible?  I love the way the devices are trackable if they are stolen but a theft can just push the off button, or erase everything by holding the home and off button.

    I can imagine with the many posts here asking about what to do when their Passcode Lock or Restrictions Passcode is forgotten when someone is unable to power their iPhone off if there were a passcode requirement option to do so.
    On an airplane and instructed to power the iPhone, iPad, or iPod Touch off before takeoff and landing and the password to do so is forgotten, or the battery is about to die with no power source available to charge and the password to power the iPhone is forgotten.

  • How to disable (turn off) a counter output

    I have a similar question up on the the board but I thought I would ask it in another way to make it simple and straightforward. 
    Can an E-series counter output be disabled (and enabled) quickly through some software command?  When I say " disabled" I mean switched off to a TTL low state.  I have tried both the "disable" counter control command and gating the counter with a TTL signal.  Both methods leave the output pin in whatever state the output happens to be in at the time of the command or gating.  I need a disable function where "disabled" automatically sets an OFF or LOW on the output.  I am using this to generate a pulse train where the pulse train switches off at certain times, and I cannot have the output remain high at these times.
    I am using traditional DAQ but if there is a method in DAQmx that works I'd be willing to try it...

    Have you tried using the following vi with a reset command (search in help, it works with the E series counters)
    Counter Control
    This VI controls groups of counters. Control operations include starting, stopping, and setting the state of active acquisitions. This VI works with DAQ-STC and NI-TIO-based devices.
    Control code 1 (reset) reinitializes the counter back to the default settings.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • How do you disable/turn off Faces???

    Faces is automatically scanning and copying photos and eating up my CPU, it's driving me bonkers. Is there a way to disable this feature? I don't want anything to do with it.
    Thx...

    I think that it's a bit simplistic to say "there is never a reason to see those small faces" and "there is no reason to ever go into your iPhoto library".
    No it's not. There is no reason to see them, there is no reason to ever go into your iPhoto Library via the Finder.
    I used the "Pictures" link on Finder to navigate to the Event in iPhoto
    Well that's not how you do it.
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • Disabling / Turning off  (or on) DHCP for IPV4 and IPV6 from Terminal

    It took some looking to find this info, so I figured I'd post it to save someone else a lot of looking. 
    networksetup -setv4off Ethernet
    networksetup -setv6off Ethernet
    networksetup -setdhcp Ethernet
    networksetup -setv6automatic Ethernet
    You can change "Ethernet" to the name of the network service (adapter) for other interfaces (ie "Wi-Fi").  Quotes may be required if there is a space in the adapter name.  "networksetup -listallnetworkservices" can give you a list of the adapters as they'd need to be entered.
    Came in handy where we needed to disable internet access for non-admin users of a Mac, and easily script a toggle for admins to use for updating the system or their own use.
    Reference:
    https://developer.apple.com/library/mac/documentation/darwin/reference/manpages/ 10.7/man8/networksetup.8.html?useVersion=10.7

    Hi Amit,
    Thank you very much for your qucik response.
    However my requirement is that the Bookmark section window should be completely disabled or should not be displayed at all to the user when he opens that PDF which might contains 2 or 3 pages of data
    Any solution for this from BO side?
    Thanks
    Naga Nanda Kishore.

  • C5-00 How to disable/turn off colourful smiley?

    Hello,
    Its very annoying that Nokia included in new software update smileys without any way to turn them off. Not all people like them.
    I find it very annoying to use my C5 now only because these smiley show up.And I use text messages A LOT.
    Could anyone tell me the way on how to turn them off? Or is there any way for rolling back to previous version of C5 software?
    Or maybe, could Nokia make new update and include option for turning them off??

    In your messaging options, do you have an option called graphical smiley? If such an option is available, then it can be turned off. If not, then Nokia should address the issue.
    blitZkid
    Nokia C7: Running on Nokia Belle
    "If I'm helpful in anyway, a click of appreciation on the star would be nice"

  • Disable turn off screen while youtube is watching

    I want disable screen blanking if I am watching something in fullscreen(eg YouTube).
    If I watching movies in offline player (VLC) there is no problem, screen not blanking. It happens when I watching online players like YT.
    How can i fix them?

    solamir wrote:
    You can launch your browser by script:
    #!/bin/bash
    firefox &
    while true
    do
    xdotool key shift; sleep 60
    done
    Xdotool will be pressing shift key once a minute. Сertainly package xdotool (from community) must be installed in your sistem.
    http://xkcd.com/196/
    solamir, if you want to paste a snippet of code, please use [ code ] tags
    like this
    It makes the code more readable and - in case of longer listings - more convenient to scroll through.

  • Can not disable, turn off, mute or remove Apple boot start up chime using Yosemite 10.10.1

    I understand why Apple forces the boot chime upon us for marketing and diagnostics, but I really want to disable the start up chime when booting my MacBook Pro laptop. 
    I have tried the sudo commands that worked in Mavericks.
    nvram SystemAudioVolume=%80
    and
    nvram SystemAudioVolume=%00
    They do not work with Yosemite. 
    I have also tried muting my laptop before shutting down and muting the sound entirely in System Preferences.  This method does not work either.
    Every time I boot the laptop I have to annoy every one in the library, or the cafe, or the airport, or the workplace.
    Anyone have a solution for this?

    Same here. I've been wanting to disable this since very long time ago, and started actively looking for it when I bought my first macbookpro (rmbp13) last year. You won't get any answers because there isn't a solution.
    We get it, this is for diagnostics. But with most laptops being non-serviceable these days, it doesn't make sense to push boot up chime for everyone. It's really annoying when my coworker boots up her machine, and this has been going on since as back as I can remember.
    With 10.10.1, I have to often times force power-off my rMBP13 late-2013 model, and I'm the one making that obtrusive boot noise. Why can't Apple just make a preference check box as an option in system preference? I'll praise you guys and call it Magical.
    Apple, please make an option to disable the boot chime noise!

Maybe you are looking for

  • Windows 8.1 upgrade fails with error code 0x80070057

    I have attempted to upgrade Windows 8 Pro (Msdn) to 8.1. The install gets as far as 'Applying changes, then comes up wiith the extremely helpful error message 'The application wasn't installed'.  Clicking on view details gives, the  equally helpful,

  • Problem with file content conversion for multiple substrcture. Please help!

    Hi Experts,    I am using file content conversion in file sender communication channel. The input file is a flat file with data like this:    A01 AA8I0NBVDA      20090704     84900    A02 AA8I0NBVDA      20090704     84900    A03 AA8I0NBVDA      2009

  • Dell Ultrasharp 2707WFP 27" and G5

    Hi there, hoping someone can help. I am interested in the Dell Ultrasharp 2707WFP 27" widescreen LCD monitor but I need to know if it is compatible with my computer (I contacted Dell but they said to try the Apple forums). Here are the specs for my c

  • Bootcamp 'Glowing' windows logo freeze after gfx driver install

    Bootcamp 'Glowing' windows logo freeze after gfx driver install Last week suddenly, after having changed or installed nothing, trying to boot into windows resulted in a frozen glowy window logo 'Starting Windows', which resulted in having to format t

  • How to Copy backup to new ipad

    How to Copy backup to new ipad?