Choice displays only the first option.

hi,
I am having problem with the "Choice" menu i created. It is displaying only the first choice option, though i select other choices...Meaning, it's displaying only "23.0" whatever other values i select...any suggetions?
Thanks in advance.
public class equalneutron extends Applet implements MouseListener{
//        ... (variable declaration)
         Choice distance = new Choice();   
         public void init() {       
           addMouseListener(this);       
           distance.addItem("23Mpc");       
           distance.addItem("60Mpc");       
           distance.addItem("100Mpc");       
           distance.addItem("200Mpc");       
           distance.addItem("500Mpc");       
           distance.addItem("1000Mpc");       
           r_Mpc=distance.getSelectedItem();       
           add(distance, BorderLayout.NORTH);       
           ItemListener il = new ItemListener() {       
               public void itemStateChanged(ItemEvent ee){                         
                   if(r_Mpc.equals("23Mpc")){               
                       r = 23.0F;           
                  }else if(r_Mpc.equals("60Mpc")){               
                       r = 60.0F;                           
                  }else if(r_Mpc.equals("100Mpc")){               
                       r = 100.0F;           
                  }else if(r_Mpc.equals("200Mpc")){               
                       r = 200.0F;           
                  }else if(r_Mpc.equals("500Mpc")){               
                       r = 500.0F;
                  }else if(r_Mpc.equals("1000Mpc")){
                       r = 1000.0F;
distance.addItemListener(il);   
// ...... rest of the code

it is allways returning 23.0 because tou've initialized r_MPC to the selected value which is 23.0 at the beginning.
You must reask the selected value in the listener :
ItemListener il = new ItemListener() {                      
public void itemStateChanged(ItemEvent ee){
String selected = distance.getSelectedValue().toString();
// the rest of your code
hope it'll help

Similar Messages

  • Char displaying only the first three characters in the cube

    Hi Experts
    I have a char  with lenth 60 and it's active.I am updating this char via the update routine whereby i am reading data from an active table of an ODS as i update in the update rules.
    But surprisingly,once the load is succesful and complete,upon checking the data in the active table it's displayin the way it should be the problem comes in when I view the data on the cube which displays only the first three chars even if the descriptionis a 60 character field.
    Please help

    Hi Herbert,
    Have you checked in the infosource or transfer rules, what is the length of the infoobject, if you are loading the data to PSA, please check there it self, whether it is displaying 60 characters or only 3 characters.
    Thanks
    Sat

  • App file sharing: files are displayed only the first time...

    clicking somewhere else and then back to the application that you want to share files are not there any more.
    I've to close and re-open the itunes in order to see them again.
    itunes is running on windows 7 64bit.
    is this a bug ?
    thank you.

    Hi! I have the same, exact problem. The files are displayed only the first time I look at the apps listed under File Sharing. If I look at another app on the list, the files on the one I previously checked are gone when I look at it again. Is there any way to fix this? I have a Lenovo X61s on Windows XP Professional 32 bit.

  • Display only the first record

    I have report in BEx where we want to find the first time a customer ordered Quantity of more than 500 in a data range (For Ex: From April 10 to April 30). In a particluar date range the customer may order more than once (Qty > 500). The catch is we want display only one first time he ordered qty > 500.
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
              4/22/2005        12,290 CA
              4/23/2005        4,826 CA
              4/26/2005        6,397 CA
              4/27/2005        1,538 CA
              4/28/2005        4,849 CA
    XYZ         4/25/2005        2,000 CA
              4/26/2005        12,000 CA
              4/27/2005        4,500 CA
              4/28/2005        6,300 CA
    In the output report we want to display the first record for each customer as:
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
    XYZ         4/25/2005        2,000 CA
    Your help is really appreciated. Thanks.

    jayant,
    i think, you could use your date as a condition to filter by in your report... try looking that the properties of your KF and, under Calculations, set the 'Calculate Result as...' to the first value only.
    hope this helps - don't forget to give out points. =)
    ryan.
    ps. i've tried this, and it sort of works - just need a bit more of tweaking around. =)
    Message was edited by: Ryan Kristoffer Tan

  • When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, and the safe search button is inoperable. Suggestions?

    When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, the remainder of the results page is blank, and the safe search button is inoperable. When I turn off private browsing and refresh the page, everything works again.
    Anyone else having this problem?

    I have got the same behaviour after the last Safari Update to 5.1.3. It seems that Safari now handles some scripts in a new way. If you debug the Google Website, you will see, that there is some Javascript Error, that seems to prevent to write into local cache. After some searching I wasn't able to finde a solution for this problem, other then disabling Javascript while private browsing to prevent the script loading. You then are able to use Google with the old layout. The option to disable JavaScript can be found in the Menu "Developer", wich has to be enabled in Safari in the options first.
    In my opinion this is a bug that is now occuring, because Apple changed something in private browsing and that has to be fixed by Google now, to run again. Or we will have to wait for 5.1.4, as you can read online Apple will change and bugfix the javascript engine in that version, perhaps this fixes the problem as well. I hope so!
    If anyone is in the developer program perhaps you could test this with the beta of 5.1.4 and tell us if it works.

  • I used a code i got with my moive to download the itunes version and i was watching the itunes extras, but now when i click on "play itunes extras" it plays the audio but the only thing it displays is the first frame (the movie is catching fire)

    i used a code i got with my moive to download the itunes version and i was watching the itunes extras, but now when i click on "play itunes extras" it plays the audio but the only thing it displays is the first frame (the movie is catching fire) i deleted the movie and reinstalled from my icloud backup and it still does the same thing. The actual movie works fine, its just the itunes extras

    Hi there MickeyDresaj,
    You may find the troubleshooting steps in the article below helpful.
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/ts1718
    -Griff W. 

  • Some images do not display in browser, iPad Air 2.  When I load a page with several jpgs (one 1920x720, then 8-10 800x800px), only the first few are shown.  Behaviour is similar for Safari and Chrome. Website issue or iPad?

    I have just bought an iPad, partly to check that my websites work OK on mobile devices.   When I load a page with several jpgs (e.g. one 1920x720, then 8-10 800x800px), only the first few are shown.  If I remove the large one, that sometimes fixes the problem. Behaviour is similar for Safari and Chrome. Is this a website issue or iPad?

    Sorry, I didn't make myself clear.  I'm using a new Wordpress theme that is meant to be responsive.  The large image is for a header, than you scroll down to see the rest, one by one.  Some one the pages work OK on my iPad, typically the old ones where the maximum image size was 500 x 500.  It's the new pages and those I've updated that are causing the problem.  On the iPad the large image loads, then a couple of the small ones become visible as I scroll down, but then darkness (rather like my knowledge level).
    Being new to IOS and iPads, I'm trying to work out whether I should be looking here, or amongst the Wordpress stuff for a solution.
    Here's the website with its new theme: http://www.new-zealand-pictures.com/

  • I purchased a movie pack (2 movies) and only the first one downloaded? i have tried to download the second movie but the itunes thinks the iphone allready has it and gives the option to "watch" instead of "download"? help

    i purchased a 2 movie pack from itunes, only the first movie downloaded? how do i get the second one, when i go to download the second movie i only get a "watch" button where the "download" button would normally be? help

    Hello there, matt12003.
    The "Watch" button in the iTunes Store usually indicates the movie is already on your device. The following link from iPhone Basics shows the steps on how to view your content on your iOS device:
    Videos - Learn more about iOS 7 and iPhone - Apple Support
    http://support.apple.com/kb/index?page=tidetail&product=iphone&locale=en_US&tag= Videos#TI209
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • MuVo N200 screen displays only the Creative l

    I have owned my Creative MuVo N200 for 3 years. Recently, it will display only the Creative logo. Although I know that music is loaded on there, the songs are neither displayed nor are they played. Is it time for a new MP3? What is the life expectancy anyways?

    kungfookiller,
    Try downloading the latest firmware update from website and use it to update and format the player. Remember to check the option 'Format Data Area'. Backup your player data first though.
    Jason

  • Lately when I do an images search only the first page actually shows the images- the rest show blank squares- why, and how do I fix it?

    Over the last week I have noticed more and more that my searches do not show up properly. Today only the first page of images actually show, the rest are blank spaces, but if I click they go to the image site. The rollover does not show either.
    What can cause this, and how do I fix it? I have tried various safe settings but this has no eefect at all.
    Thanks.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • Why does only the first page of seach results show, with further pages graying out?

    In a search, I may get >1,000,000,000 hits, but only the first page is readable. "Next" gives me a grayed out screen and FF freezes. Any of the offered searches at the bottom of that first screen will do the same thing. Repeated hitting "back" will clear it.
    This has been true, through all the upgrades, including a backgrade to 3.6 (?) for 64-bit. This makes FF useless as a search platform, though it is my preference, even over Chrome, if it would work.
    Windows 7 Ultimate, 64-bit, 8GB Ram
    High speed to house, wireless lan in house

    That does seem rather useless.
    Use Automator - it has a "PDF to Images" action that will do exactly what you need. Drop your document into the workflow, drop the "PDF to Images" action in right after that, set any options that you need (like where to save) and then click "run"
    Barring that, I've found that sometimes Adobe Reader will sometimes work well for documents that Preview can't print, and I've found some documents that Adobe Reader chokes on but Preview handles flawlessly.

  • When downloading a file, only the first word of the attached file is included in the 'file name' field, not the entire file name, as it used to.

    Regardless of filetype, only the first word of the file is filled into the "Enter name of file to save to..." dialog box. I'm set up to 'save file' in the FF Options > Applications tab for the basic MS and Adobe files. To successfully use/find the downloaded file, I type in the remainder of the file name. Have I overlooked an additional setting? Running FF 18.0 on a Win7 PC.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    A possible cause is that the server sends a wrong response header.
    The server may not comply to RFC 5987 and sends a wrong Content-Disposition:attachment; filename header.
    * https://developer.mozilla.org/en/Firefox_8_for_developers#Network

  • HT203175 My Ipod does not sinc with all of my Itunes library, only the first few albums. I recently changed my operating system to XP from Vista, which was a pain, and due to my fault had to reinstate most of my albums and all of the playlists.

    Ipod does not sinc with all of my Itunes library, only the first few albums. I recently changed my operating system to XP from Vista, which was a pain, and due to my fault had to reinstate most of my albums and all of the playlists. How do I get my Ipod to sinc fully when I access Itunes?

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

  • Drop Down Box Choose A Name and Have only the first name show up

    I am creating a form for health care.
    I have a drop down box with names of Physicians... their full names so they can be easily identified. And then subsequent fields that will be populated based off of the choice. However What I need is that after the full name from the drop down list is selected than only the Dr's First name shows up in the box to be distributed through out the file. All the rest of the information is already in using this Java:
    switch(this.rawValue){
        case "MD":
            form1.Page1.Physician1LastName.rawValue = " Acccc";
            form1.Page1.Physician1Number.rawValue = "1111111111";
            form1.Page1.Physician1Fax.rawValue = "2222222222";
            form1.Page1.ClientEmail.rawValue = "[email protected]";
            form1.Page1.Physician1Address.rawValue = "xyz suite ";
            form1.Page1.Physician1City.rawValue = "XYY CIth";
            form1.Page1.Physician1State.rawValue = "XZ";
            form1.Page1.Physician1Zip.rawValue = "11111";
            form1.Page1.Physician1NPI.rawValue = "111111111";
            form1.Page1.Physician1License.rawValue = "ABBB111111";
            form1.Page1.Physician1UPIN.rawValue = "A11111";
            form1.Page1.Physician1Specialization.rawValue = "Internist";
            break;
    And is working beautifully thanks for previous help everyone.
    Here is the example from the Drop Down list choices:
         Dr. Aaaaa Abb Accccc
         Dr. Baaaa Bbb Bccccc
    I would like to choose :
         Dr. Aaaaa A Aaaaa
    and upon chosing it have it show only the first name in that field so it can be processed correctly through out the rest of the fields.
    ie:    Aaaaa   (Only nothing else)
    I am a horrible at this stuff I just surf around until I find something that works and copy and paste and play until it works
    So Please be specific:
    Java vs FOrm: Client: Choice   and code ....
    Thanks SO much ....

    Take a look at the attached. The script assumes the name is a three-part string such as Dr. Frank Burns. You can modify it according to your needs.
    // form1.page1.dd::exit - (JavaScript, client)
    if (this.rawValue != null) {
      var doc = this.rawValue;
      var i = doc.indexOf(" ");
      doc = doc.substring(i+1,doc.length);
      this.rawValue = doc.substring(0,doc.indexOf(" "));
    Steve

  • Only the "first section" of CC notes is shown on each slide.

    Hello,
       I have a lot of TTS and CC notes in my presentation.  Although, the box of every "CC note" section is clicked, the CC notes don't proceed beyond the first section.   I have looked at the CC timeline, and the second second should begin at 13 seconds, the third at 19 seconds, and so forth.  During playback, the only the first section is shown for the entire slide.  Any ideas as to what could be wrong? 
    Thanks for any help!
    Ryan

    OK.  Then something isn't quite making sense for me here.
    I just performed a quick test readin of the first line of CC text showing in your screenshot and it came out at 30 seconds.  So I cannot see how the TTS text voice (which is usually slower than mine) would come out at only 14 seconds or so.  It would have to sound like a chipmunk to fit that amount of text in the time frame you say it is using.
    My guess is that the CC text is not appearing perhaps because you have far too much text in each line.
    Try breaking up your text in so smaller chunks.  For example, here's a screenshot of the module I'm currently working in.  I always set my CC text up so that no more than one line is visible at a time.
    I have the CC options in the skin set for the CC section to be 3 lines high and the text is as shown below:

Maybe you are looking for