Image on the list

Hi all.
Is that possible for me to put image in the JList?
If yes, how do I add?
Thanks guys.
Budi

  // Display an icon and a string for each object in the list.
class MyCellRenderer extends JLabel implements ListCellRenderer {
     final static ImageIcon longIcon = new ImageIcon("long.gif");
     final static ImageIcon shortIcon = new ImageIcon("short.gif");
     // This is the only method defined by ListCellRenderer.
     // We just reconfigure the JLabel each time we're called.
     public Component getListCellRendererComponent(
       JList list,
       Object value,            // value to display
       int index,               // cell index
       boolean isSelected,      // is the cell selected
       boolean cellHasFocus)    // the list and the cell have the focus
         String s = value.toString();
         setText(s);
         setIcon((s.length() > 10) ? longIcon : shortIcon);
           if (isSelected) {
             setBackground(list.getSelectionBackground());
            setForeground(list.getSelectionForeground());
         else {
            setBackground(list.getBackground());
            setForeground(list.getForeground());
        setEnabled(list.isEnabled());
        setFont(list.getFont());
         return this;
String[] data = {"one", "two", "three", "four"};
JList dataList = new JList(data);
dataList.setCellRenderer(new MyCellRenderer());

Similar Messages

  • Adding Images to the List component

    Adding Images to the List component while using the FLV
    PLayback
    All, ( i can send you my source files if it would help)
    I'm using the FLV Playback component and loading videos into
    it from an external xml file. I also have a list component tied to
    the FLV playback that when you click on one of the elements in the
    list, it plays that movie.
    QUESTION:
    My question is how do I add an image to the list component?
    Below is the xml file and the actionscript. I've added the image
    attribute to the XML file as img="time_square.jpg" and added the
    element of the array when calling/creating the list. Did I do this
    right?
    Any direction would be very much appreciated.

    Adding Images to the List component while using the FLV
    PLayback
    All, ( i can send you my source files if it would help)
    I'm using the FLV Playback component and loading videos into
    it from an external xml file. I also have a list component tied to
    the FLV playback that when you click on one of the elements in the
    list, it plays that movie.
    QUESTION:
    My question is how do I add an image to the list component?
    Below is the xml file and the actionscript. I've added the image
    attribute to the XML file as img="time_square.jpg" and added the
    element of the array when calling/creating the list. Did I do this
    right?
    Any direction would be very much appreciated.

  • How to add new images to the list of old images to ipod using itunes

    I have around 1000 images in my ipod right now. I want to add some more images tinto it. I just have the latest phots in a folder in my PC. When i try to sysnchronize my ipod with a folder to add the new phots i am getting a warning message stating "All my photos will be replaced with the new folder". But the problem is i don't have my older photos in my folder.
    Will my older photos be deleted when i sysnchronize with a new folder?
    How can i add my latest phos alone?
    Can somebody help and answer my questions?

    Somebody please help me

  • Insert Image in SharePoint List & Display Image from SharePoint List using C# Pragmatically

    hi 
    i have a share point custom list with the following columns and its types.
    Title--------------->Single line of test 
    FirstName--------------->Single line of test
    LastName--------------->Single line of test
    Description--------------->multiple line of test
    Link--------------->Hyperlink or Picture
    Image--------------->Hyperlink or Picture
    I've to create a visual web part with the following input fields and which can insert following items in the above list columns
     Title                  asp textbox
    First Name         asp textbox
    Last Name        asp textbox
    Description        asp textbox
    Link                  asp textbox
    Image              file upload control
    Submit             asp button
    when i click browse button for image control in above web part it browses image .jpg,jpeg or .png file from my computer into image input field above and when i click submit button it must be submitted in the Image column in the above list.
    i want to know how can i do that in c# pragmatically. 
    i've another visual web part which should read the image from the list in Image column and display it in image control on the web part.
    like this
    <img id="imgdisplay" runat="server" src="" />
    how can i read image from image column through c# pragmatically.

    Hello,
    You can't directly add picture into "Hyperlink or Picture" column because this column takes URL value and image is binary etc. You can first upload that picture into picture library (create new picture or document library) then add that image link
    into that column.
    To add/edit "Hyperlink or Picture" column, SP provided special class called "SPFieldUrl". Wheer you need to pass URL and description as parameter.
    Refer this link for you ref:
    http://stackoverflow.com/questions/23829576/how-to-decide-sharepoint-url-field-is-set-as-hyperlink-or-picture
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Certain websites like Craigslist show a scrambled, blurry security word image that the user has to type into a field in order to submit an ad. With Firefox, the word doesn't show up in the field. I have to open Explorer to accomplish this task.

    When a user posts an ad on Craigslist, they are sent an e-mail with a link. Clicking on this link brings the user to a page where the ad content can be checked, and the last step is to retype the scrambled security word into a field. When I'm on Firefox, this word (which I'm assuming is an image file like a .jpg or a .bmp) does not appear.
    I just had this same problem on a website called Sailing Anarchy when trying to register a new account.

    If images are missing then check that you aren't blocking images from some domains.
    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    * Check the permissions for the domain in the current tab in Tools > Page Info > Permissions
    * Check that images are enabled: Tools > Options > Content: [X] Load images automatically
    * Check the exceptions in Tools > Options > Content: Load Images > Exceptions
    * Check the "Tools > Page Info > Media" tab for blocked images (scroll through all the images with the cursor Down key).
    If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    There are also extensions (Tools > Add-ons > Extensions) and security software (firewall, anti-virus) that can block images.
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Is there a way to add images to the collection used in Photomerge Style Match?

    When one uses the menu: Enhance->Photomerge® Style Match, there will be six images displayed to choose from. The path to them is (Mac):
    /Application/Contents/Resources/models/ While this menu is only available in Expert mode, you end up in Guided when you choose it. I assume, therefore, that there is actually an Action or at least a script.
    Simply adding an image wouldn't work, which I confirmed. Even rebuilding the MediaDatabase.db3 didn't help. But there must be more than just the simple jpeg that the app uses to perform the effect... or maybe not! ;-) All I'd like to know is if there is a way to add images to the list of choices.
    Thanks!

    What version of photoshop elements and mac os x are you using?
    Once your in the Style match screen you add images using the Green Plus button
    (the screenshot is from photoshop elements 12)

  • If you right-click an image you can select to "Block Images" from the site, but how do you reverse this choice?

    If you right-click an image on a web page you can select to
    "Block Images from [the url of the site]".
    This works well, particularly to make the page printer-friendly, but how do you reverse this choice to see the images again?

    You can see all permissions for the current page in Tools > Page Info > Permissions
    If it is from a different domain then use this:
    *A way to see which images are blocked is to click the favicon (<i>Site Identification</i> icon) on the left side of the location bar.
    *A click on the "More Information" button will open the Security tab of the "Page Info" window (also accessible via "Tools > Page Info").
    *Open the <i>Media</i> tab of the "Page Info" window.
    *Select the first image and scroll down though the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.

  • Hello, Sorry I have this new version problema. Ustanovil mozily are no longer automatically load images in the settings of this feature is enabled.

    Здравствуйте, извините у меня такой вопрос. Я установил последнюю версию мозилы, и у браузер перестал автоматически открывать изображения, данная функция включена в настройках.

    You can use these steps to check if images are blocked:
    *Open the web page that has the images missing in a browser tab.
    *Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    *Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    *Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    *Select the first image link and scroll down through the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    *https://support.mozilla.com/kb/Images+or+animations+do+not+show
    *http://kb.mozillazine.org/Images_or_animations_do_not_load

  • I recently downloaded photoshop elements 10 for dummies on ipad and the images that the book refers to dont show all I see is a ? where the pic should be. Any help will be appreciated.

    Hi, I recently downloaded photoshop elements for dummies from ibooks to use on my ipad, the book refers to pictures throughout however what are supposed to be pics and diagrams only show up as a ?. Im unsure why and dont know how to get the pictures to show. Any help will be greatly appreciated.
    Thanks
    Daniel

    You can use these steps to check if images are blocked:
    *Open the web page that has the images missing in a browser tab.
    *Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    *Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    *Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    *Select the first image link and scroll down through the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    *http://kb.mozillazine.org/Images_or_animations_do_not_load
    *https://support.mozilla.com/kb/Images+or+animations+do+not+show

  • Using a devices camera and adding the image to the display list

    Hi,
    My students and I have not been able to make an AIR app that can take a picture using the devices camera and then add the image to the display list. We are able to open the devices camera and of course take a picture, but that's it.
    We've been using these two tutorials/examples:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/CameraUI.ht ml
    and
    http://tv.adobe.com/watch/adc-presents/input-for-mobile-devices-camera/
    I've uploaded our project: http://www.dayvid.com/professor/camera.zip
    Can someone help us out?
    Thanks!
    Below is the main document class:
    package  {
    import flash.desktop.NativeApplication;
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.ErrorEvent;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.MediaEvent;
    import flash.media.CameraUI;
    import flash.media.MediaPromise;
    import flash.media.MediaType;
    import flash.events.MouseEvent;
         public class Main extends MovieClip{
              private var deviceCameraApp:CameraUI = new CameraUI();
              private var imageLoader:Loader;
              public function Main()
                   this.stage.align = StageAlign.TOP_LEFT;
                   this.stage.scaleMode = StageScaleMode.NO_SCALE;
                                     camera_btn.addEventListener(MouseEvent.CLICK, cameraBtnClicked);
                          private function cameraBtnClicked(event:MouseEvent):void
                                    if( CameraUI.isSupported )
                                                      result_txt.text = "Initializing camera...";
                                                      deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );
                                                      deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );
                                                      deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );
                                                      deviceCameraApp.launch( MediaType.IMAGE );
                   else
                                                      result_txt.text = "Camera interface is not supported.";
              private function imageCaptured( event:MediaEvent ):void
                   result_txt.text = "Media captured...";
                   var imagePromise:MediaPromise = event.data;
                   if( imagePromise.isAsync )
                    result_txt.text = "Asynchronous media promise.";
                    imageLoader = new Loader();
                    imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );
                    imageLoader.addEventListener( IOErrorEvent.IO_ERROR, cameraError );
                    imageLoader.loadFilePromise( imagePromise );
                   else
                    result_txt.text = "Synchronous media promise.";
                    imageLoader.loadFilePromise( imagePromise );
                    showMedia( imageLoader );
              private function captureCanceled( event:Event ):void
                   result_txt.text = "Media capture canceled.";
                   NativeApplication.nativeApplication.exit();
              private function asyncImageLoaded( event:Event ):void
                   result_txt.text = "Media loaded in memory.";
                   showMedia( imageLoader );   
              private function showMedia( loader:Loader ):void
                   this.addChild( loader );
              private function cameraError( error:ErrorEvent ):void
                   result_txt.text = "Error:" + error.text;
                   NativeApplication.nativeApplication.exit();

    Hi,
    Do I have to add the picture to the cameraroll in order to add it to the AIR apps display list?
    Both examples from Adobe claim that their examples work. Do they not?
    In the example, the event handler asyncImageLoaded is never called. The output text field shows -   result_txt.text = "Asynchronous media promise."; So the Event.COMPLETE is being added. But I don't think it's being dispatched.
    Any ideas?

  • How can I remove the list of 20 recently saved items when you click on the arrow on the far right side of the File Name screen for images, web pages, ect?

    When I right click and go save image/page/ect as the file save popup screen appears and on the right side of the File Name bar there is an arrow. If you click the arrow it shows the last 20? items that have been saved and their save location. Is there anyway to not have the list of recent items there or at the very least a way to clear them? I'm running Firefox 17 on Windows 7.
    Also when you save items as you were typing in the name you want to save them as it used to show filenames with the same name as you type that are saved in that directory so instead of typing the whole filename or copy/pasting you could start typing a filename and then hit the up or down arrow, backspace and just change the end of the filename without having to retype the entire filename.
    Hopefully you understand what I mean and can help me fix it, thanks.

    It's in the proper directory. I can scroll down the window on the right and see the files but if I start typing the file name of one of them the autocomplete drop down thing that shows matching file names does not appear. In the back of my mind I'm starting to think a setting got changed and then the list of matching file names stopped appearing but I can't recall what setting may have been changed, if it was a firefox or microsoft change or for certain if anything got changed at all. Yeah I know I'm not helping my own cause but what can you do.

  • How do i backup the list of load images automatically exceptions under Options- Content. I want to transfer to another comp without re-adding one at a time

    How do i backup the list of load images automatically exceptions under Options->Content. I want to transfer to another comp without re-adding one at a time. EVen if there is no way to backup, what is the system file for Firefox that stores these, so i can transfer this file or open it in an XML or similar editor to copy them out?

    The permissions.sqlite file stores 'allow' and 'block' exceptions for cookies, images, pop-up windows, and extensions (software) installation.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder
    See also:
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • While using a drop-down menu i.e. File, edit, image, or even when saving as and choosing the file type; the list appears and I am able to highlight what i want but cannot click on anything.

    While using a drop-down menu i.e. File, edit, image, or even when saving as and choosing the file type; the list appears and I am able to highlight what i want but cannot click on anything. This is becoming incredibly frustrating. It happens at random time and a restart of the computer is all that helps, then with out any notice it starts to do this again.  Mac Book Pro i7 2.2 16 GB 1333 Ram, (2) 450GB SSD both internal to machine. At this point I am losing file because I am unable to save in the file type I need. Does anyone out there know how to solve this issue?
    Thanks
    phil

    I haven't been unify photoshop much in the past month, but I did try your suggestion and it seemed to work for a while. Today when i went to save a document the same thing happened: click on file>save at this point I can not click on save even though it is highlighted. Tryed to use command s that brings up the save dialogue box, but when I try to change file type I again cannot select it from the drop down menu.

  • I still use Aperture 2.1.4.  I need to export an image file with a CMYK profile.  Whereas a generic CMYK profile is listed in ColorSync Utility, it does not appear on the list of profiles in the edit portion of the export preset dialogue.  Help?

    I still use Aperture 2.1.4.  I need to export an image file with a CMYK profile.  Whereas a generic CMYK profile is listed in ColorSync Utility, it does not appear on the list of profiles in the edit portion of the export preset dialogue.  Help?  Is there some way to add the CMYK profile to the list of choices that are available in the export preset dialogue such that I can choose it?

    leonieDF
    Thanks for your response.  My profiles are located within color sync utility as you can see here:   
    These profiles do not respond to clicking and dragging.  Since they are all in one place, more or less, I'm reluctant to make further attempts to relocate them.  Accessing the CMYK profile is the first difficult experience I've encountered with this arrangement.  I have never needed the CMYK profile until recently, and that need has now past.  However, it remains a mystery to me as to why it does not appear with all the others on the menu of export choices in Aperture 2, or on the menu of profile assignment choices in the Preview application (where again all the other profiles are listed as choices).  I'm beginning to think my current set up will permit me to view an image that was created in CMYK space, but does not easily assign, or convert to that space.  I don't face these restrictions with all the others, so it remains a curious circumstance for me.  I anticipate upgrading my computer and software in the near future which might alleviate this issue altogether.  Again, many thanks for your attention to this matter.  The reach of this community is astounding.

  • Image instead of List Name, and hyperlink the image to view 'All Items.aspx' page

    Hi,
    I would like remove the Page title for list (i.e., name of the list in view all items.aspx page) , and instead use image and hyperlink the image
    to 'All items.aspx" page.
    Using developer tool found the element (#PageTitle) and added 'Script Editor' webpart and below css script to it. I am successful in replace the
    title to image, however, I am unable to add the HTML tag for hyperlink. Where do I need to add or how do I add? Could anyone help me please??
    <style type="text/css">
    #pageTitle
    background-image: url('http://w2k81368:2116/SiteAssets/Test.jpg');
    background-repeat:no-repeat;
    text-indent: 100%;
    white-space: nowrap;
    </style>
    Regards,
    Sunitha

    Hi Sunitha,
    According to your description, my understanding is that you want to change the list title to an image.
    I recommend to add the code below to the list page:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function (){
    var s = "<img alt='SP' src='http://w2k81368:2116/SiteAssets/Test.jpg'>";
    var $t = $("#DeltaPlaceHolderPageTitleInTitleArea span span a");
    $t.html(s);
    </script>
    After that, the list title will change to the image and it will show allitems.aspx page when clicking the image.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

Maybe you are looking for

  • Needed Idea for the creation of this report

    HI Experts............     I need to genrate reports on the Transport status. Format of the report user entery is user id : user 001   column 1              column 2          column3        column4 No of request       devlopment     Q/A system   prod

  • Clamshell digital picture project/problem the computer sleepy !!

    Hello friends it is my first post to the board. Not sure if it the right place. I am in a mess with my old clamshell ibook ( firewire, DVD-Rom, 366mhz , macOs 9.2) which I took apart to make a digital picture display. The disassembly was easy as per

  • Change font size? - NEED ANSWER

    I've scanned this discussion and see many people asking the same question but no answers: Is it possible to change the displayed font size in the calendar view? If it simply isn't possible please be kind enough to tell us. Thank you.

  • Link in e-Mail to GP

    Hello, I have realized a GP approval workflow. Is it possible to send an e-mail to the user who is involved next containing a link which directly directs to the step the user has to perfom? Best regards Alexander

  • SetVisible(true) but doesn't show up

    What I'm trying to do is get the writeAll panel to show up when they click the Write button in the menu. I have it so it's set to invisible after it's created so it only shows up when they click the write button, only it doesn't show up. I've put bre