Show + image instead of handle in jtree

I have created jtree. I have implemented my own TreeCellRendererComponent. I set the node images as per node type. My problem is, I need to get '+' sign to nodes not expanded and '-' for those expanded instead of default handles. How do I implement it?
public Component getTreeCellRendererComponent(
                    JTree tree, Object value, boolean isSelected,
                    boolean isExpanded, boolean isLeaf, int row,
                    boolean hasFocus) {
          super.getTreeCellRendererComponent( tree, value, isSelected,
                              isExpanded, isLeaf, row, hasFocus);
          Component compObject = this;
          if ( value instanceof EuamDefaultMutableTreeNode ) {
               EuamDefaultMutableTreeNode node = (EuamDefaultMutableTreeNode)value;
               setText( node.getText() );
               setIcon(isExpanded ? node.getOpenIcon() : node.getClosedIcon() );
               if( bIsRightImage_ && lblRightSideIcon_ != null ) {
                    lblRightSideIcon_.setIcon(node.getRightIcon());
          else {
               setText(value.toString());
          return compObject;
}

Tree node handles vary depending on which L&F u r using, java defaults to "javax.swing.plaf.metal.MetalLookAndFeel" which uses the "0-" type handles. To get the '+', '-' handles you need to be using windows L&F. Try adding this code to your apps main method:
try{
   UIManager.setLookAndFeel(
        "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}catch (Exception e) {}Hope this helps

Similar Messages

  • Showing image instead of flash for mobiles?

    I am just wondering if it is possible to show an image instead of flash content for mobiles?
    I want to allow the adobe sniffer to do its thing when it is people using pc and mac browsers and direct them to the plug in page to download the flash player if they need it, but is there a way to sniff for a mobile / smart phone browser and if they cant view flash it will show an image instead?
    Any help appreciated.

    You can use Javascript to detect the browser and platform for any given user. You can then parse that information to push the content that you want to use for the result. You can find a good write-up with example code here: http://www.quirksmode.org/js/detect.html

  • Showing image instead of download link

    I am using an interactive report and entered this for the source. I want to show the picture instead of a download link however I don't get the picture I get a
    Source:
    select "IMAGE_ID",
    "SUBJECT",
    "CREATED_DATE",
    "CREATED_BY",
    decode(nvl(dbms_lob.getlength(image),0), 0, null, '<img src=
    "'||apex_util.get_blob_file_src('P53_IMAGE', image_id)||
    '" height="75" width="75" />') Image
    from "#OWNER#"."IMAGES"
    Shown in the report:
    <img src= "apex_util.get_blob_file?a=100&s=3229276571420106&p=53&d=1943731550155986&i=1941402717155956&p_pk1=1&p_pk2=&p_ck=58C90FE7F1EC9618676F23C2FC24FA0A" height="75" width="75" />
    Any idea as to what I may be doing wrong?

    Hi ,
    It looks like your report column is set to display as Text. Go to "Home>Application Builder>Application #>Page #>Interactive Report Attributes" and change it to Standard report Column and you should be all set.
    Thanks,
    Manish

  • I can't view video on imported clips on FCPX, it shows blue instead of image

    I can't view video on my imported clips on FCPX, it shows blue instead of image on the clip. I can hear sound but no video. What is the problem. I wish someone can help me on this issue? Thanks.

    The camera is Sony Handycam HDR-CX550. I used the internal hard disc to record. I can's use MTS clips if it is recorded on the internal hard disc. I converted clips into MOV, MP4, and Final Cut formats, non of them worked on Final Cut Pro X. I tried to import the same clips on iMovie, it worked but super slow. MOV and MP4 formats used to work for FCPX, the only difference is I recorded the footage with HD 1920x1080.
    The clip I imported showed as a blue thing with two rectagle shapes on it. I can hear the sound, but no video. I also imported my old clips with sam format, it worked. I tried a lot of things, no use.
    By the way, what is spwecs?

  • Firefox won't open localhost files, it downloads the file instead and then won't show images, IE9 localhost works fine.

    I have installed XAMPP to preview web pages locally. Everything works fine in IE9 but not in Firefox. When I load a localhost page Firefox downloads the file, then displays the downloaded file without showing images within the page.
    So, in IE9 the address bar looks like this (correctly): http://localhost/my_sites/WebMaestro/Exercises/Lesson8/changeImage.html
    In Firefox the address bar looks like this: file:///C:/Users/Rog/AppData/Local/Temp/changeImage-3.html

    Are you using a Firefox extension like '''Auto Save Document ''' ? If you are using then you need to disable it. The documents are stored as html-text only (no embedded objects like pictures etc.) As a result the images don't appear on browser.

  • Image Problem: CorelDraw handles but Illustrator cannot

    Hi,
    We work for News media(print), we have subscribed for graphics data from another firm, this firm produces graphics for Web/Print.
    Today we have receieved some graphics in PDF format(often), These graphics are usually done in Coreldraw or Illustrator.
    We have to change certain spelling errors and colours to suit our print, i used to open the pdf in illustrator and change the colour and font, these graphics also contain images.
    Everything was going fine, until now almost all the graphics (pdf format) when open in Illustrator, the images in the graphic appear as torn or to say corrupted(apperances), but the same graphic(in pdf format) when opened in Coreldraw, the images in graphics appear fine.
    Why this problem happens in Illustrator.
    We use Illustrator CS3 and CorelDraw X4.
    Some of the techie guys told me it has to do with resolution of the images where Coreldraw handles pictures well of low resolution and illustrator cannot.
    Here below the first graphic which was open in Illustrator shows the images in graphics as torn but in bottom graphic which was openen in Coreldraw shows images are fine.
    Any solution.
    Thanks

    Hello iebng,
    In my experience, when you open a PDF file made with QuarkXpress, CorelDraw or other program other than Illustrator, you may experience problems opening them in illustrator. This is due to the way a PDF was saved and/or the original program.
    The most common issue is the color, specially when the designer used RGB instead of CMYK color system.
    This does not mean that Illustrator is the problem. Again, sometimes depends on how the PDF file was created. But also you have to considered that Adobe Illustrator CS3 have some minor issues handling PDF files (CS4 version is worse)
    QuarkXpress is very picky handling the fonts. For example: Quark does not accept Helvetica font provide by different companies. In other words, if you Helvetica Regular font from two different companies the file can have some conflicts: therefore will affect the PDF file creating a problem when open it in illustrator. Illustrator ignores the company or font type (Postscript, True, or Open) and replaced it with the Helvetica font that you have in your system.
    As you can see in your provided samples, the text looks out of place, bolder, bigger, etc., and the colors have shifted.
    One of the solution I think can help you, is to ask the designers that when possible supply the artwork using Postscript fonts, True Fonts, or Open Fonts. Whichever works for you the best. Also give a set of specific fonts to be use in their projects.
    But you can always ask the designer to correct the typos and send a PDF file with outlined fonts.
    I think is best to keep using both programs and use them per PDF file furnished. But for printing, you cannot accept low resolution images (300 PDI only).
    Portable Document Format files are good, but needs a lot of improvement for the printing industry. All the software and computer companies should agree in one standard color system, link file handling, etc. to avoid the problems that all of us we are having.

  • Pop up a window to show images

    Hi, I am trying to show images when the user rolls the mouse
    over the image but I want to show them as a pop up window only when
    the user is on the image.
    Any ideas how can I handle this? I will have variety of
    images and want the same behavior for all of them.

    mouseOver and mouseOut event functions for the images.

  • How can i show images from different folders  in image gallery

    Hi All,
             i have downloaded and executed photo viewer image gallery application.
              in that we r showing images sequentially what we have defined in xml file.
             but i want show images randomly or i want show images from different gallary.
    Can any one help me.
    thanks
    Raghu.

    WaqarLFC7 wrote:
    On Windows:
    Ctrl + click on the songs you want to group - then right click and click get info and it will ask you if you want to get info for multiple items click YES then under album name it whatever you want and them songs will be grouped into 1 album.
    Mac:
    Same procedure but hit SHIFT instead of CTRL.
    Actually, it's right click or ctrl click, same as windows.

  • Helvetica Light Appears As An Image Instead Of Text

    Earlier i was using "Helvetica" on my Adobe Muse website that i am designing. I had to change it from "Helvetica" to "Helvetica Light" and the text started to show as an image instead of text. I mean it does not remain text anymore and when i export the site it shows as a png file. Although i can still edit the text of course.
    I have seen a question on the forum (HERE) that explains what is happening but there is no explanation how to correct it. I really want to use Helvetica Light instead of normal Helvetica. Can any one tell me how to keep it as a text instead of a png file?
    Thanks!

    Not all visitors to your website will have Helvetica Light installed on their computer, so the only way for Muse to give that exact look is to turn the text into an image.
    If you want the text to stay live text and not become an image, you have to limit yourself to the fonts in the 'web safe' or 'web fonts' categories. If you use a system font, Muse will rasterize the text to give you the exact appearance you desire.

  • How to show image in oracle adf if i have data in byte[] ?

    For first time I am using <af:inputFile> to get file of image type from any location on my system and convert the data in "byte[]" and store it in database...
    When i visit page again i need to show uploaded file which is coming to me "byte[ ] ".
    To show image i am using <af:image> component.
    Help will be appreciated.

    Check this blog post: http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    Dario

  • How to use an image instead of Browse Button in messageFileUpload item

    Hi,
    I have sessageFileUpload item in my OA Page to upload files. How can I show my custom image instead of a Browse button that is placed by default. I don't want to show the browse button instead want to use my custom image.
    Thanks

    This is a framework object, you can't change that.
    --Shiv                                                                                                                                                                                                   

  • How to have image instead of blank player screen

    I know virtually nothing about Dreamweaver and Flash...I know
    how to update page, embed .flv files, etc, and how to encode
    videos, but that's it. I am a videographer by trade. I am putting
    videos up on my new website and they are not going to be autostart.
    How can I have an image instead of a blank screen show on the
    inactive player?
    Thanks in advance

    Hi,
    In the VO list of values, check "Include no selection item", choose "Labelled item first of the list" from the drop down and give your custom label.
    Thanks

  • Is it possible to display an image instead of button in a radio group?

    I am building an application to be operated with touch screens. I would like to display radio group buttons larger than they are by default. Is it possible to make them seem larger, or to display a custom image instead of the radio group?
    Francisco

    Rather than using a radio group, have you looked into using a list? That is what we use for navigation in APEX in many places when we show large images (like App Builder home page - Run Application, Supporting Objects, Shared Components, Utilities, Export / Import).
    If you need to use radio groups, you can use the template under Globalization to include a larger, clickable image (we do that for pages like selecting the type of page to create). An example template is:
    #DISPLAY_VALUE#&lt;br /&gt;&lt;a href="f?p=4000:4700:&SESSION.::::P259_CHOOSE_PAGE_TYPE,P4700_SELECT_REPORT_TYPE:FORM,FORM_ON_A_TABLE"&gt;&lt;img src="#IMAGE_PREFIX#menu/wiz_form_140x90.gif" alt="#DISPLAY_VALUE#" class="htmldbGreenIcons" width="140" height="90" /&gt;&lt;/a&gt;
    Hope it helps -
    -- Sharon

  • Showing Image Stored In DataBase

    Hello Friends,
    I have images stored in MySQL database. In a blob field. In a desktop application i have used
    blob b=rs.getBlob("Picture");
    byte[] buf=b.getBytes((long)1,(int)b.length());
    ImageIcon imgIcon= new ImageIcon(buf);
    Image img=imgIcon.getImage();
    Graphics g=image.getGraphics();
    g.drawImage(img,0,0,320,240,image);
    the thing worked fine. But now i have to show images over web. I am not able to uderstand that how to show images. As i m unable to get Graphics from any of the component.
    Help Me,
    Its urgent,
    thanking u all
    Abhilash Jain

    The common method to include binary information (image, PDF, document, etc) is to Base64 encode the file and store the resulting character string in the XML. It would be up to the receiving system to handle the encoded information in the XML.

  • How to make mouseover effect text show image in popup window or tooltip?

    I am trying to display a popup image in a new window when the mouse moves over some text. Or perhaps, the image could display in a tooltip when the mouse moves over some text.
    However, I have achieved the functionality of an image appearing above the text when the mouse moves over some text. This is how I did this:
    I put this code into the Page HTML Header:
    <script type="text/javascript">
    <!--
    function setFirstChildImgDisplay(el,vis) {
    if(!el || !el.getElementsByTagName) return;
    el.getElementsByTagName('img')[0].style.display=vis;
    // -->
    </script>
    I created a region and put this in the Region's Title field:
    {div onmouseover="setFirstChildImgDisplay(this,'inline')"  onmouseout="setFirstChildImgDisplay(this,'none')">Check out Page 1 here <img src="#WORKSPACE_IMAGES#DGNR Preview Page 1.bmp" alt="Page 1 Preview" style="display:none;">{/div}
    I am thinking that I should not have all of this code in the Region's Title field. But, I don't know where else to put it in APEX.
    So my questions are:
    1. how to get an image to display in a popup window or as a tooltip when the mouse is moved over some text?
    2. where should the {div} content be placed in APEX, if not in the Title field?
    Please note that I used '{' & '}' instead of '<' & '>' just so the div would display in this post.
    Also, I would like to give credit to this website because this is where I found out how to do what I have provided above.
    http://forums.devshed.com/web-design-help-2/mouseover-effect-text-shows-image-321876.html
    Thank you in advance,
    Maggie

    It's just an image map. Play with the settings. Here's a shape layer making a hole in the water and adding a bit of color.

Maybe you are looking for