How to use COMBO box in prc application

am using KVM -kjava to create a graphical user interface application.First i want to put combo box in my prc appliction,i have found a class implementing combo box but i could not understand if an item is selected from combo box then the screen below the combo box is painted ,so how to restore(repaint) the screen below the combo box ...can any body send me the code..

What combo box ? Did you create it ?
As to re-painting: Determine what components were covered by the combo, and repaint them.

Similar Messages

  • How to Use Combo Boxes

    Hi, i download the code of this tutorial
    and i want to insert this in a Jdialog, i create a new JComboBox() with the name of the class that i download, i Set the path , i extend the class to JComboBox , i made the class super(); but throw me an Exception: "cannot be cast to Integer" at the
    public Component getListCellRendererComponent(
    JList list,
    Object value,
    int index,
    boolean isSelected,
    boolean cellHasFocus) {
    //Get the selected index. (The index param isn't
    //always valid, so just use the value.)
    int selectedIndex = ((Integer)value).intValue(); // here throw me the exception cannot be cast to Integer.//
    if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    //Set the icon and text. If icon was null, say so.
    ImageIcon icon = images[selectedIndex];
    String pet = petStrings[selectedIndex];
    setIcon(icon);
    if (icon != null) {
    setText(pet);
    setFont(list.getFont());
    } else {
    setUhOhText(pet + " (no image available)",
    list.getFont());
    return this;
    what should i do??
    Sorry for my English...Thanks.

    I set it manualy
    int selectedIndex = 3; it works but shows me only one selection, actually the thirt selection....i must call this method anywhere to fill the selectedIndex ?

  • Using Combo box at the backend

    Hi,
    I am using combo box at the backend to filter rows to a particular destination.
    The problem is the labels are going to populate at the runtime and the selection of item in combo box is also going to populate at the run time. I have an icon which inserts eg: country in a cell, then this cells is used by combo box as a item selection(label) to filter rows from source. But unfortunately the comb box is not selecting any value i.e no item is selected dynamically. But if i manually drill down it is working but the label is not changing dynamically based on the changes in label by icon.
    For eg my data:
    Country and profit populate at run time
    Country          Profit
    India               5000
    Germany        4000
    Now i have icon which selects country (hard coded in excel) upon clicking the mouse on it and inserts in A1 suppose the value hardcoded is "India". Now this A1 is used as a "selected item" for combo box. the source to combo box is the above country and profit which populates at run time.
    Now when i execute the dashboard. The value is inserted in A1 after clicking the icon but it is not picked up by combo box as "item selected" and hence combo box does not filter any data.
    Can any pls help.
    Thank you. I will award full points for correct solution.

    Hi Monammed,
    The said functionality should work. Please check your logic one more time. Also, try using some spreadsheet components mapped to the cells in question and understand how the data is flowing during run-time. This will help you test things. Delete spreadsheets when you are done with identifying the issue.
    Lets check the combo box mapping one more time : Map the source of the combo to the entire range; labels in the combo box ONLY to the country column in the source range(typically this may be the left most column in the range); selected item should be mapped to the cell that has the destination for the icon and the type for default selection may be dynamic. Well, if there is any hard-coding of values involved anywhere, do check the spellings and other trivial things.
    Do let me know if this was helpful and if you need any more help.
    Thanks,
    Prasanna

  • Locating on a location on GMap using combo box using SDK

    Hi All,
    I have a requirement to locate a city on google map using combo box. I want name of cities to appear in combo box and on selecting a city, map should be able to locate that city. This combo box will be visible on map itself. Combo box can be a component of either Xcelsius or Flex Builder.
    I think combo box dragged from Xcelsius component panel not able to communicate with google map which is embedded in form of swf through manage and packager.
    So, I tried with Flex Builder combo box component, but not able to done it. I am not getting the flow how to communicate between combo box and google map.
    I can locate a particular city giving a latitude and longitude through propertysheet.
    Please, if anyone could help me out asap.
    Thanks in advance!

    Hi Monammed,
    The said functionality should work. Please check your logic one more time. Also, try using some spreadsheet components mapped to the cells in question and understand how the data is flowing during run-time. This will help you test things. Delete spreadsheets when you are done with identifying the issue.
    Lets check the combo box mapping one more time : Map the source of the combo to the entire range; labels in the combo box ONLY to the country column in the source range(typically this may be the left most column in the range); selected item should be mapped to the cell that has the destination for the icon and the type for default selection may be dynamic. Well, if there is any hard-coding of values involved anywhere, do check the spellings and other trivial things.
    Do let me know if this was helpful and if you need any more help.
    Thanks,
    Prasanna

  • How to use check box in flash 8?

    How to use check box in flash 8?

    If you want it to happen when someone clicks the checkbox, then you need to add a listener for that event.
    var cbListener:Object = new Object();
    cbListener.click = function (evt:Object) {
        if (cb.selected) {
              gotoAndStop(2);
    cb.addEventListener("click", cbListener);
    (Note: "cb" and "cbListener" are names that were made up for this example.  They could be anything you want to name them)

  • What is Digital Signature, How to use it in web based applications?

    I am new to digital signatures. Any body can help me how to create a digital signature and how to use it in web based applications. Do we need certificates to use digital signatures?

    <link_farm_and_everything_else_removed_by_moderator>
    Edited by: Julius Bussche on Sep 3, 2008 8:59 AM

  • How to use " toFront() " method in java application and in which package or

    How to use " toFront() " method in java application and in which package or class having this toFront() method.if anybody know pl. send example.

    The API documentation has a link at the top of every page that says "Index". If you follow that and look for toFront(), you will find it exists in java.awt.Window and javax.swing.JInternalFrame.
    To use it in a Java application, create an object x of either of those two classes and write "x.toFront();".

  • How validate a combo box generated for a selectOne on javascript

    Hi!!
    I have a question!
    i need how validate a combo box on javascript if this is generated by selectOne
    for example:
    <tr>
    <td width="150px"><b>Cantidad a elegir:</b></td>
    <td><f:selectOne att='idisponibilidad.cantidadElegir' type='combo'/></td>
    </tr>
    this is an form and this generates in the name of the select:
    <select name="$FO$idisponibilidad.cantidadElegir">
    <option value="0">..</option>
    <option value="4">..</option>
    </select>
    but now I try to do this:
    document.form.$FO$idisponibilidad.cantidadElegir.value
    and obviously does not work!!!
    someone knows how to validate
    Thanks!!!

    Taking Mark's Code .. add an id
    <select id="personGender" <f:fieldName att="person.gender"/>>
    <c:forEach var="gender" begin="0" items="${genders}" varStatus="status">
    <c:choose>
    <c:when test="${person.gender == gender}">
    <option value="<c:out value="${gender}"/>" selected="true"><c:out value="${gender}"/></option>
    </c:when>
    <c:otherwise>
    <option value="<c:out value="${gender}"/>"><c:out value="${gender}"/></option>
    </c:otherwise>
    </c:choose>
    </c:forEach>
    </select>
    Add an id to above code. In your submit button write a function on onclick event .. like onclick="submitForm()"
    Write the functions as :
    function submitForm(){
         if(validateFileds()){
    document.<your form id>.submit();
    function validateFields(){
    if (isEmptyCombo ('personGender')) {
                   alert ( "'Selecting a gender is mandatory" );
                   focus('personGender');
                   return false;
    function isEmptyCombo (id) {
         var combo = document.getElementById(id);
         return combo != null && combo.options[combo.selectedIndex].value == "";
    function focus (id) {
         if (document.getElementById(id)) document.getElementById(id).focus();
    Thanks,
    Karmaresh
    Edited by: user856811 on Mar 15, 2010 9:22 PM
    Edited by: user856811 on Mar 15, 2010 9:22 PM

  • How to view the records in datagrid using Combo Box Selection

    hi friends,
    i having one combo box,that combo box having 10 students name in list format.
    If i click any one of the students name it will only show the Particular student record in datagrid with respective fields(student name,rollnumber,percentage);
    how i will do this
    please give any suggession or show snippet demo.
    it will be more helpful to do this,
    Thanks in advance
    B.Venktesan.

    Hi,
    As your requirement , i think you will have to use selectedItem or selectedIndex property of combobox. And accordingly fetch data and provide it to dataprovider of datagrid.Following code can help you.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection; 
    import mx.controls.Alert; 
    import spark.components.List;[
    Bindable] 
    var array:ArrayCollection = new ArrayCollection(); 
    public function insert():void{ 
    array.addItem(Combo1.selectedItem
    as String);DG1.dataProvider=array;
    ]]>
    </fx:Script>
    <s:ComboBox x="118" y="64" id="Combo1" change="insert()" >
    <s:dataProvider>
    <s:ArrayList>
    <fx:String>AAA</fx:String>
    <fx:String>BBB</fx:String>
    <fx:String>CCC</fx:String>
    </s:ArrayList>
    </s:dataProvider>
    </s:ComboBox>
    <mx:DataGrid x="118" y="154" id="DG1" >
    <mx:columns>
    <mx:DataGridColumn>
    </mx:DataGridColumn>
    </mx:columns>
    </mx:DataGrid></s:Application>
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • How to get  Subvalues using Combo box ?

    Hi , friends,
    I have one Combo box :
    Having list of all Districts
    When i select one of District it will give all related villages
    regarding District that i selected in another combo box.
    How to achieve this ? in one page itself
    I have another idea but its not good..
    where
    1) first select District from Combo
    2) Press submit
    3) second page displays another combo and fetch perticular villages
    and display in another combo.
    but this technique requires more page navigation.
    I want it should be on one page itself
    PLEASE HELP ME ....
    Ghanshyam
    Message was edited by:
    Ghanshyam

    the brand old dependent combo issue..
    as far as i know i could tell you for every two days a similar post is being posted here on the same thread..
    you could have taken a look of them....
    Anyways there are many ways of doing it....
    In the days when XmlHttpRequest Object was not invented ppl used to achieve this using Hidden iframe and then updating parent frame dropdown by calling a javascript function onload of the page. or by auto refershing the page after saving the form state inside the scope of session.
    However,using XmlHttpRequest Object (AJAX) nowdays is one of the smater ways of acheving tasks as these.
    checkout one such examples where i've posted a similar example in the last reply
    http://forum.java.sun.com/thread.jspa?threadID=5170019
    hope this might help :)
    REGARDS,
    RaHuL

  • How to fill combo box with list of all SQL server

    Ok, I know how to find all SQL servers that I need, I have code for that task, and I have Array of all servers.
    My problem is ...
    I made setup project and do a huge work, and in the end this task appear!
    I used ORCA tool to change TextBox (A) template in visual studio (2008 by the way), and I transform first TextBox to ComboBox.
    Now, the little part that I'am missing is how to fill this combo box with a result of my function for listin SQL servers?
    Can I somehow send combobox object to myMethod:
    private void FillCombo(ComboBox cmb)
          // do the job
    or
    instanceOfThisCombo.Items.Add(listOfSQLServers);
    please help me to solve this... thanksc#

    Hi Valerij,
    The ComboBox control in an MSI dialog uses the ComboBox table to populate the items in it. To get what you want, you need to update the ComboBox table in the MSI package with your application and run the MSI package. The following KB article describes how to dynamically populate a ListBox control in Windows Installer:
    http://support.microsoft.com/kb/291329
    This method introduced in the above KB article also applies to populating a ComboBox control in Windows Installer.
    I don't think it's possible to run the application as a Custom Action from within the MSI package because the application will modify the content of the MSI package which is currently running. So you need to launch the MSI package from within your application after updating the ComboBox table. In short, when installing, just run your application which updates the ComboBox table and install the MSI package.
    Hope this helps.
    If you have any question, please feel free to let me know.
    Sincerely,
    Linda Liu

  • Using Combo box to create options

    Hello,
    I am using a Framegrabber to acquire my images from our custom made sensors. We have several models so I wrote several Drivers for each one. I have managed to use a combo box with the names of the sensors to select which driver is loaded into the IMAQ board. However, because the application is getting more and more complex, and because I want to have one universal application for all our sensors, I want to have the ability to select different options according to the driver that is selected. For example, if I select Sensor A, and I want to use the serial communication, I want the address of sensor A to be used in the VI. If I choose Sensor B, the values related to sensor B are to be chosen. I guess the idea is simple to implement using an If Statement in C or other languages, but I don't want to go through that mess, and I want to implement it with LabVIEW.
    I could use a Case structure, but that only gives me two options. And I am not very good with Event structures and I do not know if I can use it for this. I also tried to use a local variable, but it would not let me change the values associated with the labels.
    If you understood what I was trying to say, and have an idea, I would greatly appreciate your help. If you are interested in helping but need a visual illustration, I can put a quick VI together for you.
    Thank you in advance,
    Rami

    Hi.
    I think I am doing something wrong, but, maybe someone can quickly enlighten me.
    The situation is this.
    I have a combo box with about 65 values. I want to feed these into a case structure (to select a range of settings to use later on)
    How do I get the values to also appear in the case headers? All I have is true and false..
    My output of the combo box is a string, not  a number. is that why I dont get the values automatically?
    I've attached the combobox and a case structure.
    /Brian
    Attachments:
    example2.vi ‏7 KB

  • Report error when using combo box and one text field is empty

    I'm building an interactive pdf in adobe pro 9. My problem is the following: I have one text field where you can enter a numeric code and that is used to populate another text field when I choose an option on one combo box.For example: suppose I write the code 123 in the text field "A" and that the combo box has two options ("data" and "-"). When I select "-", another text field "B" is empty, while when I select "data" i populate the text field "B" using the code entered "A" with the text "data_123". In order to do this I use the standard javascript code in the Format>Custom tab of the combo-box.
    My questions are:
    - how can I prevent the pdf to proceed selecting an option in the combo box when the field "A" is empty?
    - how can I update the field "B" every time that I change the text in "A"? I found that the text is "B" is updated only when I press the selection in the combo box.

    You can set the combo box to read-only in the Validate event of the A field:
    // Validate script for text field
    getField("combo1").readonly = !event.value;
    To update the value of B when A changes, you can expand the script above to something like:
    // Validate script for text field
    var f1 = getField("combo1");
    var f2 = getField("B");
    // If there is an entry in the A field...
    if (event.value) {
        f1.readonly = false;  // Make sure the combo box is activated
        f2.value = f1.value === "-" ? "" : "fa.value + event.value;  // Update the value of field B
    } else {
        f1.readonly = true;  // Deactivate the combo box
        f2.value = f2.defaultValue;  // Reset field B
    You might also want to reset the combo box somewhere in there, but it's not clear to me when you would want to do that.

  • Iterating throw UDO records by using combo box

    Hi all
    i have a form with a matrix which is connected to UDO with master data and master data lines tables.  i have a combo box which contains the Code values of the master data table.
    when selecting a code value from the combo box i want the matrix to display the master data lines data which relates to the code value which was chosen in the combo box. i want to use the UDO mechanism for displaying the data so i don't want to query the dbdatasource which is bounded to the matrix.
    question is how can i activate the UDO to display the relevant data to the code value which i chose in the combo box?
    appreciate the help
    Yoav

    move the combo to the header level.
    if the document is in find mode with correct data in the code field and u click find it will bring up the relevant data.

  • Use Combo Boxes and Datepart "m" and "y" to filter forms and reports

    I am trying to build a Form to filter through Sales Order Records going back up to four years to find purchasing patterns of  customers and to find more potential sales.  I am using a simple main form, with 2 subforms joined on the Sales Representative
    [accntrep], one which show current orders for a given month and the other orders from past months and years.  I've got 3 combo boxes, 1 to select sales representative, 1 to select a month using date part and 1 to select a month.  This would be very
    flexible in easily searching any month in any year of the recordset.  I know I will be using something like "DatePart("m",[Date])=2 And Year([Date])=Year(Date())-4" (Feb 2011) to filter my records, but I am having troubling writing
    the procedure just right.  I am using 2-column combo boxes 1 column for text i.e (April, May, June etc.) and a second for the Date Part Expression.  I think I need to concatenate the values into the filter, but I cannot come up with exactly how to
    get this done.  Any ideas??
    Thanks,
    js

    If there is any doubt in your mind then I  will suggest a sanity debug trick; temporarily add 2 textboxes
    in T1 put its control source: =ComboBoxNameMonth
    in T2 put its control source: =ComboBoxNameYear
    don't put what I typed - put in their actual control names for those 2 comboboxes
    this way you can see what is actually the value of those combo boxes... depending on what they are bound to - those values may not be what you are expecting them to be.....obviously alter the properties of the comboboxes until they have the values they should
    Am a little unclear on filtering your records in regard to how the data is not structured whether for example: Nov 2015 is in 2 separate fields or a single field like 11/2015 or what - not sure it is a true date field or possibly a text field...so
    the next part of this depends on the data structure.

Maybe you are looking for

  • Looking to purchase a MacBook Pro - I could use some advice.

    Hello everyone, First, a little background on my current situation. I recently started a new job working at a high school as a techie. This school has just over a 2:1 ratio of Mac:PC. The college I attend, however, is a 90/10 PC-oriented organization

  • Registered Sign (glyph) not showing up in glyph pallet

    I'm having trouble with the certain font (Quint) not having some glyphs show up in the Glyphs Pallet, in particular, the Registered Sign (® - the R inside a circle). It show up in every other application on my system including Quark, Word TextEdit, F

  • How to prevent pending task in GP Runtime

    Hi experts, What should I do when I don't a pending task to be in  GP Runtime when the result state is Terminated. Thanks.

  • Getting pcpu from ps command

    I'm trying to get percentage CU over a larger period. Here is what I get using the elapse time and cpu time formula. (The format is pid, % CPU, virtual mem, mem, cpu time, elapsed time, args to the process) ps -efo pid,pcpu,vsz,rss,time,etime,args |

  • Firefox sync reorder some of my bookmarks.

    Firefox sync is messing badly with my bookmarks. Three folders on my toolbar are moved to the front of the toolbar and it inverted the order of the bookmarks in one of them. It happened two times today after restarting Firefox. I fear I'll have to di