Doing a calculation form the selection in a combobox

I am trying to get the selection from the ComboBox and do a calculation. After the getting the selected item i need to do a simple calculation
eg.Combobox show a selection of the year of birth, let say 1970
Calculating the age i.e. 2002-selection(1970)
String age = (String) jComboBox1.getSelectedItem();
how do i do it?As the getSelectedItem is returning a string
Please help

Hi,
it seems a bit messy but it works:
//t is the string you get from JComboBox
Long i = new Long(t);
int k = i.intValue();
k = 2002 - k;
But if it match your program needs, i think you can fill JComboBox with Long objects.

Similar Messages

  • Why does say"To play the selected item, you must install a later version of the Adobe Flash Player. To download the Adobe Flash Player, go to the Adobe website." when I have the latest Version of it and it's just Black screen with no audio and Video?

    Why does say"To play the selected item, you must install a later version of the Adobe Flash Player. To download the Adobe Flash Player, go to the Adobe website." when I have the latest Version of it and it's just Black screen with no audio and Video? (Powerpoint Presentation 2013)

    You asked your question on the wrong forum. Try one for the Flash Player

  • Driver does not appear in the selection tab Windows8

    NDIS protocol driver does not appear in the Selection Tab and hence I can not run any tests on it. The client operating system is Windows 8 64bit Pro Premium. I tried reinstall driver several times, reboot client and studio machines, but with no results.
    Client itself is connected to the studio and is in "Ready" state.
    There was no problem running the test on the same driver with Win7 64bit client OS.
    HCK version is 8.59.29854
    The driver is build with DDK7.1.0
    Any hints on how to debug this would be helpful.
    Dmitry

    Have you uninstalled and re-install the HCK client on the test system?  This can cause the entry on the controller to not match up with the actual client system.  If this is the case, and you have done no testing on the system (as all results will
    be lost), please try this:
    1) Uninstall the DTM client from the test system.
    2) Delete the client entry from HCK studio in the machine management section.
    3) Reinstall the DTM client on the test system.
    4) Wait for client entry appear in the "Default Pool"
    5) Change client status to "Reset", wait for it to become "Ready", and try locating the target as I describe above.
    Paul - This posting is provided "AS IS" with no warranties, and confers no rights.

  • I just update my iphone 4s to ios 7.0.4 and update my macbook pro to ios maveric. Now, my iphone 4s does not sound form the speaker and the volume button up and down also does not work.I could hear the sound through the earphone. Also the airplay disapear

    i just update my iphone 4s to ios 7.0.4 and update my macbook pro to ios maveric. Now, my iphone 4s does not sound form the speaker and the volume button up and down also does not work.I could hear the sound through the earphone. Also the airplay disapear. Please advice how to downgrade to the previous OS

    Please try going to your settings area of your display. Click on General and go to 'reset all settings'
    Good luck!

  • Populating other fields in a form based on the selection in a combobox field

    We have done a form(masterdetail) in which we have a combobox field.When we make a selection in the field we require some two other fields to be automatically populated retrieving data from a table(which has the details required) based on the selection made.For eg. Selecting emp id(combobox) should populate empname and salary automatically in the form.Is this possible?If so how can this be done?
    Thanks & Regards,
    Jayanthi.S

    This is what I did following Michael's suggestion and it works fine :-
    1> Created a dynamic LOV named LOV_EMPNO as:-
    select empno,empno from scott.emp
    2> Started creating a form named FORM024_EMP2 on scott.emp.
    3> On reaching the Formatting and Validation section, I chose the EMPNO field in the left frame.
    In the right frame for EMPNO, I changed the item-type to Combobox and selected the lov LOV_EMPNO.
    Then I went to the Javascript handler section for EMPNO, chose the Javascript event onChange and in the
    adjacent Textarea, I wrote:-
    popdetails(this);
    We will create the javascript function popdetails() in the Additional pl/sql section.
    4> Click next and goto the Additional PL/SQL section and I wrote the following code in
    "...after displaying the page" area.
    (You can write this either in
    before displaying the page,
    before displaying the form,
    after displaying the form,
    after displaying the page).
    declare
    type tvcarr is table of varchar2(2000) index by binary_integer;
    l_empno_arr tvcarr;
    l_ename_arr tvcarr;
    l_sal_arr tvcarr;
    begin
    select empno,ename,sal
    bulk collect into
    l_empno_arr,l_ename_arr,l_sal_arr
    from scott.emp;
    htp.p('
    <script>
    var empdets = new Array();
    empdets[0] = new Array("","");
    for i in 1..l_empno_arr.count
    loop
    htp.p('empdets['||l_empno_arr(i)||'] = new Array("'||l_ename_arr(i)||'","'||l_sal_arr(i)||'");');
    end loop;
    htp.p('
    function popdetails(ele)
    var val = new Number();
    var thisform = ele.form;
    val = parseInt(ele.value);
    if (isNaN(val))
    val = 0;
    for (var i = 0; i < thisform.length; i++){
    if (thisform.name == "FORM024_EMP2.DEFAULT.ENAME.01")
    thisform[i].value = empdets[val][0];
    else if(thisform[i].name == "FORM024_EMP2.DEFAULT.SAL.01")
    thisform[i].value = empdets[val][1];
    htp.p('</script>');
    end;

  • How do I replace 2 pantone colors with 2 new pantone colors globally? I have a 2 PMS logo with many tint variations in it . When I replace PMS in Swatches pallette. The logo does not globally replace the selected color. es

    I have a 2-PMS color logo with many tints in it of the 2 colors. When I replace the  swatches in the logo to new colors, they convert from Book Color to CMYK. Can the printer work with that? How can I kee it a 2-color separation?
    MaryFl

    This is what I understand. You have a logo in a document that uses PMS 'A' and PMS 'B' colors and you want to change to colors PMS 'C' and PMS 'D'. If this is correct there are different ways to do this, but here is a traditional way:
    Make sure Select Same Tint is turned OFF in the Preferences. And all objects are unlocked in the document.
    Get the two PMS (C and D) in the document's Swatches Panel.
    Select PMS 'A' and bring the 'Fill' box in focus.
    From the Select menu choose Same > Fill Color.
    Click on PMS 'C' in Swatches panel to replace all PMS 'A' fills with PMS 'C'.
    Deselect all.
    Again select PMS 'A' and this time bring 'Stroke' box in focus.
    From the Select menu choose Same > Stroke Color.
    Click on PMS 'C' in Swatches panel to replace all PMS 'A' strokes with PMS 'C'.
    Deselect all.
    Similarly using the same approach replace PMS 'B' wit PMS 'D'.
    If you have CS3 / CS4 and the PMS colors in the logo are easily identifiable, you can use Live Color to change the colors pretty easily.
    Hope this helps!
    - Neeraj
    New Note: If there are gradients / blends that use these PMS colors the above approach would not work, but Live Color can.

  • What does it mean when the usecounts of Parse Tree for a view is incrementing when a select query is issued against the view?

    I'm using SQL Server 2008 R2 (10.50.4033) and I'm troubleshooting an issue that a select query against a specific view is taking more than 30 seconds consistently.   The issue just starts happening this week and there is no mass changes in data.  
    The problem only occur if the query is issued from an IIS application but not from SSMS.  One thing I noticed is that sys.dm_exec_cached_plans is returning 2 Parse Tree rows for the view -  one created when the select query is issued
    1st time from the IIS application and another one created when the same select query is issued 1st time from SSMS.   The usecounts of the Parse Tree row for the view (the IIS one) is increasing whenever the select query is issued.  The
    usecounts of the Parse Tree row for the view (the SSMS one) does not increase when the select query is issued again. 
    There seems to be a correlation between the slowness of the query and the increasing of the usecounts of the Parse Tree row for the view.  
    I don't know why there is 2 Parse Tree rows for the view.  There is also 2 Compiled Plan rows for the select query.  
    What does the Parse Tree row mean especially the usecounts column?

    >> The issue just starts happening this week and there is no mass changes in data.  
    There might be a mass changes in the execution plan for several reason without mass changes in data
    If you have the old version and a way to check the old execution plan, and compare to the new one, that this should be your starting point. In most cases you don't have this option and we need to monitor from scratch.
    >> The problem only occur if the query is issued from an IIS application but not from SSMS.
    This mean that we know exactly what is the different and you can compare both execution plan. once you do it, you will find that they are no the same. But this is very common issue and we can know that it is a result of different SETting while connecting
    from different application. SSMS is an external app like any app that you develop in Visual studio but the SSMS dose not use the Dot.Net default options.
    Please check this link, to find the full explanation and solutions:
    http://www.sommarskog.se/query-plan-mysteries.html
    Take a look at sys.dm_exec_sessions for your ASP.Net application and for your SSMS session.
    If you need more specific help, then we need more information and less stories :-)
    We need to see the DDL+DML+Query and both execution plans
    >> What does the Parse Tree row mean
    I am not sure what you mean but the parse tree represents the logical steps necessary to execute the query that has been requested. you can check this tutorial about the execution plan: https://www.simple-talk.com/sql/performance/execution-plan-basics/ or
    this one: http://www.developer.com/db/understanding-a-sql-server-query-execution-plan.html
    >> regarding the usecount column or any other column check this link:
    https://msdn.microsoft.com/en-us/library/ms187404.aspx?f=255&MSPPError=-2147217396.
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • OLAP Variable in DTP - Not able to save the selection

    Hi Guru's
    We are on BI 7.0 and supportpack 13. I am facing an issue with the OLAP variable in DTP filter . I am not able to save the selection/filter  within DTP via OLAP variable. I am able to test the values of the OLAP variable within DTP screen (just like in infopackage) , but when i save it, it does not appear in the selection.
    Have any of u faced this issue? I searched for SAP notes , but could not find any matching this issue. Could u please help?
    Thanks & regards

    Hi Voodi,
    Thanks for ur response. But i have checked that too. I am not saying that the value need to appear in selections screen. The filter in DTP is not showing a check tick mark and also no variable is found even though i had saved it and activated the DTP.
    I also checked running thisDTP and checked the selections in the header of the monitor. No selection is shown there.
    Thanks

  • A way to temporarily hide the selection box around an object while nudging it.

    InDesign
    I would like to see a simple "Hide All" type command, similar to the "Hide Extras" feature in Photoshop - this would leave the page in a blank/ "preview" like view, but with selected objects still selected and therefore able to be moved around without seeing the Blue Selection Box.
    PROBLEM:
    I am looking for a way to temporarily hide the selection box around an object while nudging it.
    I want to visually nudge items around to find the ideal placement and I find the selection box distracting how it follows the object around as it is being nudged.
    (For anyone familiar with Photoshop, —I am looking for something that works exactly like "Hide" cmd+H  (VIEW > Extras) does in PS - where the selection goes away but the object is still adjustable.

    Thanks, but I don't see how that's helpful really.
    SHIFT+W goes into full on presentation mode already.
    Also, —this still doesn't solve the problem of being able to move an element around without a selection box getting in the way.
    I don't believe that a solution exists, I'm just checking with the community if one does.

  • Cursor does not change with tool selection

    Has anybody experienced this?  My cursor suddenly does not change with the selection of tools when working on photos.  Once I roll over the picture the arrow is lost and becomes a strange 3 small things, so can't do any work accurately.  Still using PS 7 in Win 7.  This was not a problem previously.  Already uninstalled and reinstalled and problem is still there.  I have searched for where this can be fixed.  So far no luck.  Any suggestions?

    First answer, PS 7, not Elements.  Second answer, BIG THANKS, the dpi change corrected the problem. 
    It was an odd issue as PS was working fine for years and then suddenly the problem occured, even though I had not changed the dpi recently.
    A true glitch.  Thanks again for the fix.  Working fine again.

  • Can I cause checking a box to add 1 to a calculated form field?  I have a field that sums the numbers entered in several previous fields and need to be able to add "1" if a checkbox is selected as well.

    Can I cause checking a box to add 1 to a calculated form field?  I have a field that sums the numbers entered in several previous fields and need to be able to add "1" if a checkbox is selected as well.

    I think it has something to do with the way the value of the check box is exported, but I'm not sure.  With nothing being exported to Data5, Data6 displays the sum of Data1-4 rounded down to the nearest whole number and updates automatically as Data1-4 are updated.
    Right now, assuming Data1-4 are 0, where data 5 is the output of the second example and any box is checked,  "1" is displayed in data5 but nothing is added to data 6. Selecting any other check box or deselecting that check box will cause data6 to add 1 even if data5 displays "0".  By way of example:
    Selecting Check box 16 results in Data5 displays 1 and Data6 displays zero.
    Then, if any or all of Checkbox17-20 are selected, Data5 displays 1 and Data6 displays 1.
    Then, if any or all of Checkbox17-20 are deselected, Data5 Displays 1 and Data6 displays1.
    Then, if Checkbox16 is deselected, Data5 displays 0 and Data6 displays 1.

  • Doing a Trace on the ARXADLMT Approval Limits form No Select statement i

    Hi I want to see the all the SQL statements executed when I open the AR Approval Limits form(ARXADLMT). So I enabled the TRACE from the Menu(supplying password) , then opened then form and did a Query-> Execute. (The base table for the block is AR_APPROVAL_USER_LIMITS.Then I turned off the trace exited applications and went to the USER_DUMP_DEST directory of the database. From here tkprofed the latest trace file .When I look at the output file I cant see any Select statements at all. At least I should be seeing a select on the base table AR_APPROVAL_USER_LIMITS. Maybe I havent understood this process well enough- what am I doing wrong.Why is the trace not containing the select statement?
    Edited by: [email protected] on 13/06/2010 03:18

    >
    ... From here tkprofed the latest trace file ...
    >
    Pl post details of your OS and EBS versions. The latest trace file may not be the correct one. Pl search the trace files for "AR_APPROVAL_USER_LIMITS" to find the right trace file.
    How To Trace From Form, Report, Program And Others In Oracle Applications (Doc ID 130182.1)
    https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=130182.1&h=Y
    HTH
    Srini

  • CopyListItem - creating a button in the ribbon and opening the new form with selecting item id data.

    Hi,
                In Sharepoint 2013 online without visual studio, I need to create a copy button in the ribbon and by selecting a listitem and clicking the copy button. A new form has to be displayed with
    the selected listitem data. Please help me in doing this scenario.
    Scenario:
                 Since Customer does not want to enter all the data once again. The customer will select a listitem and click the copy custom button in the ribbon, the data should be loaded in
    a new form. The customer will do little modification and will click the submit button to save as a new list item.  Please help me in doing this scenario
    Thanks
    Logesh

    Hello Logesh,
    You can use SharePoint designer workflow to achieve the above requirement.
    See the below link for more details.
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=223
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Why local file destype does not appear in the parameter form ?

    Hi,
    There is a Destype option Local File but it does not appear in the list for Destype in the Parameter form.Why?
    Even file is not working & the reports server is getting hanged if i specify the destype as file & a valid file name & format is given.
    Print option from the app server is also not working, i mean remote printing.
    My App server machine can see my local printer, but when i give the print share name or literally five\\machine name..printername then too print option is not working.
    Thanks
    Mahesh

    Hi Shaun,
    I'am using 9iDS & the reports documentation says that Local File DesType Option is valid for rwclient & rwservlet.
    When your specify in the command line option it works, no issues but in web reports where i get the parameter form Destype list does not contain Local File Option.
    For web reports i use rwservlet.
    i mean to say my url is something like this
    http://oracle.guru:8888/reports/rwservlet?report=abc.rdf&userid=a/b@c&destype=cache&paramform=yes&server=myserver
    one more peculiar thing, i have reported it on Metalink.
    As you can see in the above URL i have given an argument of destype=cache, if i do not give this then my parameter for will not come up!!!, why should i give a destype for the parameter form to be displayed?
    Ok coming to my current problem..
    in 9iDS Reports is Local File supported? i.e. when i give a URL like above(My parameter form has system & user parameters including DesType,DesName & DesFormat).
    coming to the file option in DesType.
    In my parameter form if i select Destype as File & give a valid file name & a valid Desformat the report server hangs i mean there is no activity on the client & after this any report requests from any other clients is not responded by the Reports Server.
    When i check in the performance monitor of my Reports Server the CPU Utilization will be constant at 100%
    Thanks
    Mahesh

  • Can I pass the selected member at page dimension to form business rule?

    I have a business rule which will be executed when the form get loaded, the business rule is very complex, so I want to narrow down the calculation by passing the selected member at page dimension to the business rule.
    For example, I have year as page dimension, and I only want to calculate the selected year at one time? How can I do it?
    I know runtime prompt, but I don't think it's a good way, since you need to select again.
    Thanks
    Tony

    You can use a variable and a run time prompt.
    You can set the business rule options in planning to "Use Members on Form" and "Hide Run time prompt"
    This way the page/pov member will be passed into the business and into the variable.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Illustrator - Erase a straight line (Mac not windows).

    Illustrator - I am trying to tweak a logo so it has smooth edges, I am familiar with using the SHIFT key from a starting point and end point of  a eraser segment within Photoshop, however is there anything easy like this in Illustrator with using a m

  • Extending TREX indexes

    Hi Experts, may I request, can anyone suggest whether it is possible to extend TREX indexes, how it is done, if it possible to extend the search interfaces for TREX in ABAP? With unfeigned regards, Ramana Malladi

  • Alter database open

    Hi, I try to start a database with the commands startup mount alter database noarchivelog everything is ok up to now When I give the command alter database open I obtain ERROR at line 1 ORA-01092 Oracle instance terminated Disconnection forced. Why?

  • SAP SRM Presentation

    Dear All, I visited many sites and collected information regarding SRM and Business benefits for a client (ppt presentation). But... Looking for any points which can directly attract client with go ahead with SRM. In Simple, If any one have few impor

  • Checkbox type field appears unchecked in Production

    Hello, I have to modify an application in crm portal, but I don´t not know what might be happening, because in DEV is sure and PRD the checkbox is unchecked. How can I do to customize this field to always be marked when starting an application? Thank