JTree � doesn�t show text in combination with icon correctly.

I am trying to display in each node different (custom) icon (or none � according to the info read from file) + text. The icons are of different sizes (no t greater than 16 x 16 pixels). In each node from left first the icon is displayed than the text. My problem is that in some nodes not the whole text is drawn, only three dots indicate that there should be some more text. I suppose that the 'paint � or �getTreeCellRendererComponent � method does not add the icon�s width to the total node width represented by Jlabel. Maybe calling method �nodeChanged� could solve the problem, but I cannot call it from �getTreeCellRendererComponent � as it creates endless recurrency. Here is the code for the changed method:

public Component getTreeCellRendererComponent(JTree tree, Object value,
� ��������� boolean sel,
����������������� boolean expanded,
����������������� boolean leaf, int row,
����������������� boolean hasFocus) {
� ���
� ��� //String stringValue = tree.convertValueToText(value, sel, expanded, leaf, row, hasFocus);
� ��� String stringValue = value.toString();�
� ��� this.tree = tree;
� ��� this.hasFocus = hasFocus;
� ��� setText(stringValue);
� ��� if(sel) {
� ��������� setForeground(getTextSelectionColor());
� ��� }
� ��� else {
� ��������� setForeground(getTextNonSelectionColor());
� ��� }

� ��� // SET APPROPRIATE ICON FOR EACH NODE
� ��� TreePath actualNodePath = tree.getPathForRow(row);
� ��� Object actNode = null;
��� if (actualNodePath != null)
��� � actNode = actualNodePath.getLastPathComponent();
��� if (actNode != null && actNode instanceof TreeNodeGIS) {
��� � TreeNodeGIS actualnode = (TreeNodeGIS)actNode;
��� � if (actualnode.xmlNode != null) {
��� ������� setIcon(getNodeIcon(actualnode.xmlNode, defaultIconPath));
��� ������� DefaultTreeModel dtm = (DefaultTreeModel) tree.getModel();
� ��������� //((DefaultTreeModel)tree.getModel()).nodeChanged(actualnode);
��� � }
��� }
� ��� // end SET APPROPRIATE ICON FOR EACH NODE
��� setComponentOrientation(tree.getComponentOrientation());
� ��� selected = sel;
� ��� return this;
� }

Thank You in advance for every advice.
Lubos.

The problem about calling nodechanged() in the getTreeCellRendererComponent() is that if U call from within that method U get indirect recursion - it seems that calling nodechanged() fires an event that calls getTreeCellRendererComponent() and so on.. Because I tried that and the whole application seized to respond for a while and the threw some exception - i do not remember which one - but the list of problems was too long - as by endless recursion stopped just by the Virtual machine (stack overflow or smth. like that). And I do not know from where should I call that method nodechanged(), as getTreeCellRendererComponent() is called within swing somewhere.
Could someone help me?
Lubos.

Similar Messages

  • [SOLVED] Steam doesn't show text anymore even with -no-dwrite

    wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite
    Wine cannot find the ncurses library (libncursesw.so.5).
    fixme:ver:GetCurrentPackageId (0x33e460 (nil)): stub
    ILocalize::AddFile() failed to load file "public/steambootstrapper_english.txt".
    Edit: Fixed by logging out and closing, then it worked again.
    Last edited by lolwtfidk (2015-02-28 03:30:58)

    In my post I referred to the problem of digiKam v.1.1.0 not autorotating images correctly anymore when it's downloading and processing them from the camera, whereas v. 1.0.0 did so correctly (without to my knowledge having any Kipi plugins installed).  I.e. v.1.1.0 is configured to autorotate but it doesn't really do it; it doesn't rewrite the EXIF orientation tag.  It does display portrait images correctly in its own viewer (and so does Gwenview) but the other programs don't when they access these images in the album directory.  They show the wrong orientation but none of them, Gwenview included, has any problem in allowing me to manually rotate the image to the correct orientation that can then be passed on e.g. to Thunderbird.
    Of course, I could process all the images taken in portrait orientation manually, e.g. in GIMP, but why do so when digiKam 1.0.0 and earlier used to do it automatically.  Besides, the image rotation in digiKam is supposed to be lossless which may not be true if I use other programs.
    Again, a short summary: portrait image from camera downloaded with digiKam -> displayed correctly in digiKam (and Gwenview) but not really rotated according to EXIM tags -> can be rotated further (another 90 deg) and saved in digiKam or Gwenview and can then be displayed correctly in GIMP, Firefox and Thunderbird but would not be correctly displayed anymore in digiKam and Gwenview.
    I haven't figured out how to rotate images in Gwenview from the CLI, hence can't produce any error messages.
    Sorry to be so verbose again.

  • Safari showing text as boxes with A in them after upgrade to OSX lion

    Hi,
    After upgrading to OSX Lion and the new Safari that comes with it 6.0. It is showing a lot of the charachters on some websites as a box with a capital A in them. These are then pastered all over the site.
    If i go to other browsers it is fine. Also when i copy and paste these A boxes it to the search bar it shows the correct text. But when viewing the page it is impossible to view the text and makes for an unpleasant browsing experience.
    Any idea how to fix this issue? Is it a font issue? I have not changed any of my fonts and I would assume that the browser would be using a standard web font.
    Any help on solving this riddle would be appreciated.
    Thank you.

    Font problems and management in OS X
    Troubleshooting Bad Fonts in Mac OSX

  • Old text messages combining with new text messages

    When I send a text message one good message is sent out along with another text message that is a combination of my current message and some random message from months ago that has already been deleted. The message will occasionally also contain CL_IOS. any ideas on why this is happening

        That's definitely an odd combination, caseyhemmes. Are you using the default message application? Did you recently activate this device? What was your previous device? Can you please check the following settings: Select your Message application>Menu>Settings>Uncheck Enable signature if currently checked.
    AndreaS_VZW
    Follow us on Twitter @VZWSupport

  • PDF File in Preview doesn't show text fields, but OK in Adobe Acrobat

    Someone emailed me a pdf document which I opened in Preview. All the the text fields where there was supposed to be data were blank.
    I then opened in Acrobat and everything was there. Saved a copy from Acrobat and opened in Preview and the text was finally visible.
    Anyone have a clue why this would be happening?
    I'm running Leopard 10.5.1

    We get these files from the vendor , he creates the file in Adode illustrator for us  and he saves the f
    ile in PDF format and sends them . He aslo advised he can open
    the filre in acrodat pro version  and the print pervi
    ew is fine and he can print the file with out any issue.
    VJ

  • The program selected for NZB files doesn't show in the open with/download dialog box even though it is the default in Options window - Applications panel

    Grabbit is listed as the default program for opening NZB files in the Applications panel. When I try to open an NZB file it is not automatically selected, nor is it on the list of optional programs. Consequently, I have to click through the list of installed programs in Windows and point Firefox to grabbit.exe.
    Although the file is listed as Grabbit NZB in the Applications panel rather than just "NZB", I didn't have a bit of a problem when I had XP installed.

    1) Well, I can set IE as the default program for html/htm files, as well as any other browsers/text editors. There is no issue in setting the default program for html/htm files. This issue is- htm/html files can't be opened when I click on 'open' option
    (like temporary internet files get opened) just to view the files  in IE when I set IE as default program for htm/html files. Please note that this issue is only when I click 'open' just to view the file. If I download and save the file, the file opens
    in IE perfectly when IE is set as default program. 
    2) Regarding clicking 'open' button:- I want that if default program for opening htm/html files is set as IE, when I click the open button, the file should get opened in IE (as temporary internet files open). This is not happening when I set IE as default
    program for htm/html files. 
    3) Files do get opened when I click 'open' button in IE, but ONLY WHEN default program is some other browser/text editor. And yes they get opened in the browser/text editor which is THEN set as default program.
    4)Yes, I've tried turning protected mode off, lower the security level, set custom level to medium/medium-low but no benefit as such.
    5) If I download/save the file, and then open the file, with default program set as IE, the files get opened successfully. I think the issue is that IE is not opening htm/html files as temporary internet files  (when user just tries to view/open the
    attachment rather than download/save it) when default program is set as IE itself. Is this expected behavior?

  • PSE8 Organizer doesn't show folders that start with a number

    when i try to "Get Photos and Videos from Files and Folders", folders that begins numerically does show up?

    Hi ..
    thanks for the your efforts about my problem. 
    after reading  your message about how "20Myfolder" works for you, i did a bit more  experimenting. it seems like my initial assumption was wrong. it is  actual any folders with a period in its name that cause it not to show  up. eg. i name my folders "01.Photos" 
    thanks

  • Firefox doesn't show text on certain websites.

    On several websites that I visit regularly (e.g. Autosport.com) Fiefox will not display text whilst other browsers do. This is very frustrating because I much prefer Firefox!
    I have screenshots of Firefox v IE but apparently I can't post them until I have a received a reply.

    ''davidgoodlad [[#answer-710139|said]]''
    <blockquote>
    How safe is it to delete Lucida Grande from my Windows Fonts folder?
    </blockquote>
    I think it depends on how it got there. If it was dropped by Safari for Windows, which is no longer a product that Apple supports, I think it's safe to remove. If it belongs to some other software, then that software might object to losing the font. I'm not sure of the best way to determine that. I suppose you could hedge your bets by dragging it into a different folder so Windows just doesn't see it.

  • Older iPod doesn't show podcasts when syncing with new iTunes

    Although I have had my older iPod for approximately 7 years, I have never had any problems with it until this latest iTunes update. Since the update, I my podcasts are not showing up on the iPod. When I click on "sync" it completes almost immediately (in the past it has taken time for my weekly podcasts to transfer). I think this might have something to do with the new podcast app organization that is used with my iPhone and newer devices that utilizes aps. However, I use my iPod for my daily commute, and if I can't find my podasts to listen to, I am going to be VERY disappointed in Apple's latest change. I am hoping that there is an answer to this problem, but am afraid my old iPod may be be in the process of becoming outdated...
    Yes, I did scroll through my albums and artists to see if I could find the podcasts, but without success (unless I am just looking in the wrong place).
    Help!! Has anyone else experienced and/or resolved this issue?
    Thanks!

    Hi Arryla
    Welcome to Apple Discussions
    Take a look at the following link. It should tell you how to do what you want.
    Note the bit at the bottom as well, seeing as you are using windows.
    http://docs.info.apple.com/article.html?artnum=61131

  • On the Zunerama Forums my Zunecard doesn't show but is fine with IE

    Hi all, when I go to the forums on Zunerama.com my Zunecard, which is like a signature should load up, (I think it flash) sometimes it does, but most of the times it says 'loading' but doesn't get any further than that. Occasionally it shows, that's what is baffling me.. for example before I turned the PC off last night it was fine, but this morning, it's back to not showing,
    all other sites work fine.
    If I use slow Internet Explorer it will load up fine.
    I have updated Flash and Java.
    anybody any ideas?, I don't really want to go back to IE

    You're welcome

  • Skype chat window doesn't show text after a call

    After making a call with Skype, ANY chat window stops displaying text as you type in a message. Any ideas on how to fix this ? Skype 7.9 on MacOS Yosemite 10.10.3 Graeme 

    Please,  run the DirectX diagnostics tool (32-bit version).
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Part of .pdf doesn't show text when opened in firefox but does show when downloaded to the desktop

    when I open this link within firefox the chart (page 3 on) doesn't open. When I download the .pdf to my desktop all the information is filled in.
    http://www.tradestocksamerica.com/dsr-pdf/TheDailyStockReport_2013-02-25-Monday_Morning.pdf
    i noticed on my laptop, where the entire contents of the .pdf is viewable, within Firefox - under
    Firefox / Tools / Options / Applications / there is an app called JPS file whereas on the desktop this app does not appear

    Have you researched the site you mentioned? I went to it and WOT gave me a red flag.
    At this moment, we are aware of issues pertaining to PDF.js and we suggest installing the following add-on: https://addons.mozilla.org/en-US/firefox/addon/pdfjs/

  • My ipad VIDEOS app doesn't show the movie Names with IOS 7

    I just upgraded to IOS 7.  The Apple VIDEOS app no longer displays the file name for videos that don't have album art.  I have to tap on each video screen shot (which is typically meaningless) to bring up the info/play screen to see the movie's "Name".  Under IOS 6.1.4 (and prior versions) the VIDEOS app displayed the .mp4 file name underneath all videos without album art.
    Is there an option to set to get the "Name" displayed on the VIDEOS main screen, or get a LIST view rather than an icon view, using IOS 7? (I have not found one)
    Since most of my movies do not have album art this makes the VIDEOS app virtually useless.

    OK, I gave up.  You just can't fight city hall.
    After messing with changing from 'Movie' to 'Home Video' I just said screw it.  I just finished doing the following for my 64 'Home Video' movies:
    - I did a Google image search on <movie name> poster
    - I clicked on the thumbnail to bring up the image
    - I did a right-click SAVE IMAGE AS
    - I then did a GET INFO on the movie through iTunes
    - I clicked on the ARTWORK tab
    - I added the image I just found as the the artwork
    - I change the MEDIA KIND back to MOVIE
    - I then recopied the movies I keep on my iPad (about 10) from the PC
    No more problems now either with viewing the local or Shared movie lists from my iPad. As I add new movies I will make sure to manually add the artwork.  What a PITA.
    Hopefully Apple will get this fixed. This movie UI painfulness (that wasn't even a problem on IOS 6.x) is something worthy of Microsoft.

  • During the setting up of my new iphone 4s music doesn' t show  as a selection with icloud

    i tried to set up my iphone 4s and itunes 10.5.2 to share music via i cloud
    in settings>store>automatics downloads menu i had to activate apps and books as a choise ( there wasn 't a choise for music such i see in user manual)
    Same in itunes edit>preferences>automatics downloads i had the same two choices
    Also i don't have any imatch menu such as it reported there is under the store menu
    i only see the genius activate choise
    please help me understand what is the problem 

    You need iTunes 10.5 to be able to sync an iPhone 4S. If you have an older version of iTunes, you'll need to upgrade iTunes to the latest version.
    Regards.

  • How do I have a text field combined with a date field?

    I want to add in a series of blank boxes to fill in - that have a date option next to each box. Does anyone know how to do this?

    Currently we only support a table of fields or multiple fields on one line. In late january we will be providing the ability to put multiple fields on one line. I think that might meet your needs.
    Randy

Maybe you are looking for