Using the Combo Box

I am trying to use the combo box, so that the users can type as well as go through the drop down and pick there choice.
But I have three issues
1. Whats happening is as soon as I type it in and hit submit it will not do anything, until and unless I click on the drop down and then go and click submit.
2. The combo box is a text box and the numbers are not sorted, is there a way to sort numbers for a combo box
3. How do I make the selection appear as the user is typing, for example If I type in 55, it should bring all the entries starting with 55.
I am using Entrylist which is derived by a standard BAPI.
Any help would be much appreciated.
Thanks,
Naseer

Hi Marcel,
I have selected the action as "System Action" "Submit"  "Self". But it still does not work.
The other thing is the COMBO box is a TEXT box and the Values are "NUMBER" values so even when I select "sort" at the Entrylist level it would not sort it properly, simply because COMBO BOX is a Text box.
Please let me know if I am clear enough in explaining myself.
Waiting for you reply..
Thanks a lot Marcel.
Naseer

Similar Messages

  • How to use the Combo Box In MAtrix Colums

    HI Experts,
    Good Mornong.How to use the Combo Box In MAtrix Colums?
    Regards And Thanks,
    M.Thippa Reddy

    hi,
    loading data in to the combobox on form load.but, it should be done when atleast one row is active.
    the values what ever you are inserting in to combo should  be less than or eqhal to 100 or 150.if it exceeds beyond that performance issue arises.it takes more time to load all the data.so, it is better to have 100 or less.
    oMatrix.AddRow()
    RS = Nothing
    RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    RS.DoQuery("select ItemCode,ItemName from oitm")
    oCombo = oMatrix.Columns.Item("ColumnUID").Cells.Item(oMatrix.RowCount).Specific
    For i = 1 To RS.RecordCount
          If RS.EoF = False Then
                oCombo.ValidValues.Add(RS.Fields.Item("ItemCode").Value,RS.Fields.Item("ItemName").Value)
                RS.MoveNext()
          End If
    Next
    the above code is inserting data from database to column combobox.
    you can fill combo directly also as shown below.
    oCombo.ValidValues.Add("x","1")
    oCombo.ValidValues.Add("y","2")
    oCombo.ValidValues.Add("z","3")
    oCombo.ValidValues.Add("","")
    and what ever the values you are filling into combo should be unique.other wise it shows valid value exists.
    regards,
    varma

  • How do you use the combo box to populate a text box

    I am a beginner when it comes to Java Script.  I have viewed many different discussions, look at a lot of "help" articles dealing with Acrobat 9 and Java Script, but only to be left confused and dazed.  I am hoping someone will be able to tell me how to write a script that will populate a text box that is on my form with the combo box selection's export value...
    Thanks

    If you want the text box to be read-only, just set it up with the following custom calculate script:
    // Set this field value to the value of the combo box
    event.value = getField("combo1").value;
    but replace "combo1" with the actual name of the combo box field.
    If you want something else, post again with more information.

  • Question about using the Combo Box feature!

    I have a form that I am trying to create for our company that will allow our field nurses to select what they need and print it more effieciently.  The problem is that some of the selections are too long and I can't get the Combo box feature to allow them to be printed on multiple lines:
    I have spoken to my supervisor about redoing the form to look like this:
    But in order for us to meet state guidelines it has to be formated like the first because that is the state form given to us.  I want to be able to either:
    A) have the combo box multi-line auto text sized so it will get all the information into each box
    OR
    B) create text boxes at the end of the form that auto enteries the selected data from the second picture into boxes that look like the first picture.
    Is there any way to do either of these?

    A) No.
    B) Yes. Create a text box with the following code as the custom calculation
    script (assuming the name of the combo is "Combo Box1"):
    event.value = this.getField("Combo Box1").value;
    That way, when the user makes a selection in the combo-box, the value will
    also appear in the text box. Just make sure to make the text box read-only
    and set the combo-box to apply the selection immediately.

  • How to populate the combo boxes that are created dynamically in jsp

    Hi,
    I am using JSP.
    I am creating combo boxes dynamically (based on the num selected by the user). These dynamically created combo boxes need to have A-Z as options (each box) . Now, when the user chooses the option A in any of the combo-boxes,the rest should not have this option. so on..
    how do i achieve this.Kindly help.

    You'll need to use JavaScript...I have a complicated example and a simple example, however, I cannot really understand the complex example but I know how it works. The looping is too complex for me.
    First you'll need to populate a server side variable...depending on how often the data is updated you may want this to run each time a new session is created...this example is run each time Tomcat is started and the application context is initialized:
    package kms.web;
    // Servlet imports
    import javax.servlet.ServletContextListener;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContext;
    // utility imports
    import java.util.Map;
    // domain imports
    import kms.domain.LocationService;
    import kms.domain.DeptService;
    import kms.domain.PatentService;
    * This listenter is used to initialize
    * the Maps of Locations, Patents & Depts used to populate
    * pulldown lists in JSPs
    public class InitializeData implements ServletContextListener {
        * This method creates the Maps.
       public void contextInitialized(ServletContextEvent sce) {
          ServletContext context = sce.getServletContext();
          LocationService lServ = new LocationService();
          // Create the Maps
          Map campuses = lServ.getCampuses();
          Map buildings = lServ.getBuildings();
          Map floors = lServ.getFloors();
          Map locs = lServ.getLocations();
          // And store them in the "context" (application) scope
          context.setAttribute("campuses", campuses);
          context.setAttribute("buildings", buildings);
          context.setAttribute("floors", floors);
          context.setAttribute("locs", locs);
          DeptService dServ = new DeptService();
          Map depts = dServ.getDepts();
          context.setAttribute("depts", depts);
          PatentService pServ = new PatentService();
          Map patents = pServ.getPatents();
          context.setAttribute("patents", patents);
          //I did this one myself
    /*    CodeService cServ = new CodeService();
          Map masterMks = cServ.getCodes();
          context.setAttribute("masterMks", masterMks);
        * This method is necessary for interface.
       public void contextDestroyed(ServletContextEvent sce) {
       // I have no clue what the heck this is for???
       // Let me know if you do!
    }So now we travel into the PatentService method called 'getPatents();' which in turn calls a PatentDAO method
    Map patents = pServ.getPatents();
    Below is the code for the PatentService object:
    package kms.domain;
    import kms.util.ObjectNotFoundException;
    import java.util.*;
    * This object performs a variety of dept services, like retrieving
    * a dept object from the database, or creating a new dept object.
    public class PatentService {
       * The internal Data Access Object used for database CRUD operations.
      private PatentDAO patentDAO;
       * This constructor creates a Dept Service object.
      public PatentService() {
        patentDAO = new PatentDAO();
    public Map getPatents() {
          Map patents = null;
          try {
            patents = patentDAO.retrieveAll();
          // If the dept object does not exist, simply return null
          } catch (ObjectNotFoundException onfe) {
            patents = null;
          return patents;
    }It may be useful for you to see the code of the Patent class:
    package kms.domain;
    /*** This domain object represents a dept.
    public class Patent implements java.io.Serializable {
      private int codeGgm;
      private String name = "";
      private String description = "";
      private int creator;
      private String creationDate = "";
      private int used;
       * This is the full constructor.
      public Patent(int codeGgm, String name, String desc, int creator, String creationDate, int used) {
        this.codeGgm = codeGgm;
        this.name = name;
        this.description = desc;
        this.creator = creator;
        this.creationDate = creationDate;
        this.used = used;
      public Patent() { }
      public int getCodeGgm() {
          return codeGgm;
      public void setCodeGgm(int codeGgm) {
           this.codeGgm = codeGgm;
      public String getName() {
        return name;
      public void setName(String name) {
          this.name = name;
      public String getDesc() {
        return description;
      public void setDesc(String desc) {
          this.description = desc;
      public int getCreator() {
          return creator;
      public void setCreator(int creator) {
             this.creator = creator;
      public String getCreationDate() {
          return creationDate;
      public void setCreationDate(String creationDate) {
             this.creationDate = creationDate;
      public int getUsed() {
           return used;
      public void setUsed(int used){
           this.used = used;
    }And here is the Database table which stores the Patents:
    DESC PATENT:
    CODE_GGM NUMBER(3)
    NAME VARCHAR2(15)
    DESCRIPTION VARCHAR2(250)
    CREATOR NUMBER(10)
    CREATION_DATE DATE
    USED NUMBER(1)
    So, we then travel into the code of the PatentDAO to see how the DAO object executes the DB query to get all of the Data we need for the select list:
    package kms.domain;
    import javax.naming.*;
    import javax.sql.*;
    import java.util.*;
    import java.sql.*;
    import kms.util.*;
    * This Data Access Object performs database operations on Patent objects.
    class PatentDAO {
       * This constructor creates a Patent DAO object.
       * Keep this package-private, so no other classes have access
    PatentDAO() {
    * This method returns a Map of all the Dept names
    * The key is the Dept id
    Map retrieveAll()
           throws ObjectNotFoundException {
          Connection connection = null;
          ResultSet results = null;
          // Create the query statement
          PreparedStatement query_stmt = null;
          try {
            // Get a database connection
          Context initContext = new InitialContext();
           DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/keymanOracle");
           connection = ds.getConnection();
            // Create SQL SELECT statement
            query_stmt = connection.prepareStatement(RETRIEVE_ALL_NAMES);
            results = query_stmt.executeQuery();
            int num_of_rows = 0;
          Map patents = new TreeMap();
             // Iterator over the query results
            while ( results.next() ) {
                patents.put(new Integer(results.getInt("code_ggm")), results.getString("name"));
             if ( patents != null ) {
                      return patents;
                    } else {
                      throw new ObjectNotFoundException("patent");
           // Handle any SQL errors
         } catch (SQLException se) {
            se.printStackTrace();
           throw new RuntimeException("A database error occured. " + se.getMessage());
        } catch (NamingException se) {
          throw new RuntimeException("A JNDI error occured. " + se.getMessage());
          // Clean up JDBC resources
          } finally {
            if ( results != null ) {
              try { results.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( query_stmt != null ) {
              try { query_stmt.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( connection != null ) {
              try { connection.close(); }
              catch (Exception e) { e.printStackTrace(System.err); }
    private static final String RETRIEVE_ALL_NAMES
          = "SELECT code_ggm, name FROM patent ";
    }Now when you wish to use the 'combo box' (also called select lists), you insert this code into your jsp:
    <TR>
    <%@ include file="../incl/patent.jsp" %>
    </TR>
    depending on how your files on your server are organized, the "../incl/patent.jsp"
    tells the container to look up one directory from where the main jsp is to find the 'patent.jsp' file in the 'incl' directory.
    I need some help creating multi-level select lists with JavaScript:
    Can anyone explain this code:
    <%@ page import="java.util.*,kms.domain.*" %>
    <jsp:useBean id="campuses" scope="application" class="java.util.Map" />
    <TR><TD ALIGN='right'>Campus: </TD>
    <TD>
    <select name="campus" size="1" onChange="redirect(this.options.selectedIndex)">
    <option value="0" selected>No Campus</option>
    <% LocationService ls = new LocationService();
       Iterator c = campuses.keySet().iterator();
       Map[] bm = new Map[campuses.size()];
       Map[][] fm = new Map[campuses.size()][0];
       Map[][][] lm = new Map[campuses.size()][0][0];
       int i2 = 0;
       int j2 = 0;
       int k2 = 0;
       int jj = 0;
       int kk = 0;
       while (c.hasNext()) {
          Integer i = (Integer)c.next();
          out.print("<OPTION ");
          out.print("VALUE='" + i.intValue()+ "'>");
          out.print( (String) campuses.get(i) );
          out.print("</OPTION>");
          bm[i2] =  ls.getBuildingsByCampus(i.intValue());
          fm[i2] = new Map[bm[i2].size()];
          lm[i2] = new Map[bm[i2].size()][];
          Iterator b = bm[i2].keySet().iterator();
          j2 = 0;
          while (b.hasNext()) {
            Integer j = (Integer)b.next();
            fm[i2][j2] = ls.getFloorsByBuilding(j.intValue());
            lm[i2][j2] = new Map[fm[i2][j2].size()];
            Iterator f = fm[i2][j2].keySet().iterator();
            k2 = 0;
            while (f.hasNext()) {
              Integer k = (Integer)f.next();
              lm[i2][j2][k2] = ls.getLocationsByFloor(k.intValue());
              k2++;
              kk++;
            j2++;
            jj++;
          i2++;
       } %>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Building: </TD>
    <TD>
    <select name="building" size="1" onChange="redirect1(this.options.selectedIndex)">
    <option value="0" selected>No Building</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Floor: </TD>
    <TD>
    <select name="floor" size="1" onChange="redirect2(this.options.selectedIndex)">
    <option value="0" selected>No Floor</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Room: </TD>
    <TD>
    <select name="location_id" size="1">
    <option value="0" selected>No Room</option>
    </select></TD>
    </TR>
    <script>
    var cNum = <%=i2%>
    var bNum = <%=jj%>
    var fNum = <%=kk%>
    var cc = 0
    var bb = 0
    var ff = 0
    var temp=document.isc.building
    function redirect(x){
    cc = x
    for (m=temp.options.length-1;m>0;m--)
      temp.options[m]=null
      temp.options[0]=new Option("No Building", "0")
      if (cc!=0) {
        for (i=1;i<=group[cc-1].length;i++){
          temp.options=new Option(group[cc-1][i-1].text,group[cc-1][i-1].value)
    temp.options[0].selected=true
    redirect1(0)
    var group=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group[i]=new Array()
    <% for (int i=0; i< bm.length; i++) {
    Iterator bldgs = bm[i].keySet().iterator();
    int j = 0;
    while (bldgs.hasNext()) {
    Integer intJ =(Integer) bldgs.next(); %>
    group[<%=i%>][<%=j%>] = new Option("<%=bm[i].get(intJ)%>", "<%=intJ%>");
    <% j++;
    } %>
    var group2=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group2[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group2[i][j] = new Array()
    <% for (int i=0; i< fm.length; i++) {
    for (int j=0; j< fm[i].length; j++) {
    Iterator flrs = fm[i][j].keySet().iterator();
    int k = 0;
    while (flrs.hasNext()) {
    Integer intK =(Integer) flrs.next(); %>
    group2[<%=i%>][<%=j%>][<%=k%>] = new Option("<%=fm[i][j].get(intK)%>", "<%=intK%>");
    <% k++;
    } %>
    var temp1=document.isc.floor
    var camp=document.isc.campus.options.selectedIndex
    function redirect1(x){
    bb = x
    for (m=temp1.options.length-1;m>0;m--)
    temp1.options[m]=null
    temp1.options[0]=new Option("No Floor", "0")
    if (cc!=0 && bb!=0) {
    for (i=1;i<=group2[cc-1][bb-1].length;i++){
    temp1.options[i]=new Option(group2[cc-1][bb-1][i-1].text,group2[cc-1][bb-1][i-1].value)
    temp1.options[0].selected=true
    redirect2(0)
    var group3=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group3[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group3[i][j] = new Array()
    for (k=0; k<=fNum; k++) {
    group3[i][j][k] = new Array()
    <% for (int i=0; i< lm.length; i++) {
    for (int j=0; j< lm[i].length; j++) {
    for (int k=0; k< lm[i][j].length; k++) {
    Iterator locs = lm[i][j][k].keySet().iterator();
    int m = 0;
    while (locs.hasNext()) {
    Integer intM =(Integer) locs.next(); %>
    group3[<%=i%>][<%=j%>][<%=k%>][<%=m%>] = new Option("<%=lm[i][j][k].get(intM)%>", "<%=intM%>");
    <% m++;
    } %>
    var temp2=document.isc.location_id
    function redirect2(x){
    ff = x
    for (m=temp2.options.length-1;m>0;m--)
    temp2.options[m]=null
    temp2.options[0]=new Option("No Room", "0")
    if (cc!=0 && bb!=0 && ff!=0) {
    for (i=1;i<=group3[cc-1][bb-1][ff-1].length;i++){
    temp2.options[i]=new Option(group3[cc-1][bb-1][ff-1][i-1].text,group3[cc-1][bb-1][ff-1][i-1].value)
    temp2.options[0].selected=true
    </script>
    This produces a related select list with 4 related lists by outputting JavaScript to the page being served. It works the same way as the first example that I describe but I don't understand the looping...maybe someone could explain how to go from the single select list to a double and/or triple level drill down?

  • How I can stop the combo box with list of values from fireing validations

    Hi I'm using Jdeveloper 11.1.2.3.0
    Using Hr Schema employees table
    I Display employees data in af:table
    and I make List Of values on Department_id filed to easy change the employee department
    and another one on Job_id filed
    and Imake them UI Hints as ( combo box with list of values ) in the employeesVO
    the problem is when I Select a value from department or jobs ( combo box with list of values )
    fires the entire filed validations for mandatory atributes
    Note : the af:table Property ( contedelivery) is set to (immediate )
    How I can stop the combo box with list of values from fireing validations

    check it out.,
    http://andrejusb.blogspot.in/2012/09/what-to-do-when-adf-editable-table.html

  • Can I have a blank field on my document when using a combo box with a drop down list in Word 2011 for Mac?

    I am creating a drop down list using a combo box in the Developer tab. Once I protect my document I want the field to remain empty and not show any of the items on my drop down list. Is there a way to do this? Currently it shows one of the items on my list.
    Thanks

    Paul's answer is correct.
    Since this is a Word IT forum for Windows, in the future you should use the
    answers.microsoft.com forum. It specializes in Word for the Mac. BTW - Paul stops by there also, so you'll still get his advice from there. :-)
    Kind Regards, Rich ... http://greatcirclelearning.com

  • Control the combo box select of COPY FROM in Delivery Order

    Dear all
    I have a requirement where in the user wants to restrict the "copy from" button on the delivery order. They want the delivery orders to be created only from Sales orders.
    So that would mean that i do a bubbleevent = false when any other row is selected in the combo box dropdown. But I am not able to get the control to the combobox.
    In the system information it says that the form is "-9876", but couldnt catch any event on it either.
    Any suggestions to control the selection of the "COPY FROM" combobox is most welcome.
    Thanks in advance
    Rashmi

    Hi Use This Ihave Checked This
    If pVal.Before_Action Then
                    If pVal.FormType = 140 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT And Not pVal.InnerEvent Then
                        If pVal.ItemUID = "10000330" Then
                            If pVal.PopUpIndicator = "2" Then
                                objAddOn.objApplication.SetStatusBarMessage("You Can Not Copy From Returns")
                                BubbleEvent = False
                                Exit Sub
                            ElseIf pVal.PopUpIndicator = "0" Then
                                objAddOn.objApplication.SetStatusBarMessage("You Can Not Copy From Sales Quotations")
                                BubbleEvent = False
                                Exit Sub
                            End If
                        End If
                    End If
                End If
    Mohamed Zubair

  • Special characters in the combo box

    Hi OIM Gurus,
    I have populated some values with special characters in combo box,when i select the option it should show me the result set ,instead it shows"Illegal Characters Entered
    The data provided contains special characters that are not allowed. "
    is look-up a good option ? or any other fix for the combo box?
    Thanks in advance,
    Cats Paw

    I forget what I used (combo box, enum, etc) but I tried to put a + and - sign in and switch between the two. While the - sign showed up correctly, when the user went to select from the drop down, it was a separator! Not very intuitive! I thought a \ would escape it, but no luck.
    CLA, LabVIEW Versions 2010-2013

  • How to get values in the combo box in a XML form?

    Hi All,
        1. I have created a property which has "Default value" as "Clothings" and  "Allowed Values(csv)" as Real Estate - Sales , Clothings etc" by navigating to KM > CM > Global Services > Property Metadata > Properties.
       2. In the XML form builder when I drag this property I get a combo box for this property.
       3. But when I preview this by going to Content Management > Folder > New > FORMS > and select my XML form project I get a preview but it is not showing me the default values in the combo boxes which I created using the property in XML form builder.
    Please Suggest me as to how to get those values (which I mentioned in property) in the combo box ?
    Thanks in Advance,
    Jasmine.

    Hi All,
      I ll make the above Query Simple.
    1.In Xml Form Builder when you drag a property which has some 3-4 assigned values so you are  recomended to use a combo box.
    2.But the problem after using COMBOBOX is I am not getting these values in the preview of the combo box.
    3.Help Required please its urgent.
    Thanks in advance,
    Jasmine.

  • Drill Down from chart to webi trigger automatically while changing the combo box seelction

    Hi Experts,
    The problem is if I select the box  in the heat map, it will take me to a webi report then if I come back to the dashboard and change the combo box. The selection is not deselected, As the selection is still there it selects the value in the changed heat map there by automatically triggering the URL and redirecting to Webi Report automatically.
    Can any one Please help me to resolve this,i really would appreciate your help.
    Thanks,
    Prasad

    This is a typical issue when the xcelsius components do not have auto-deselect property.
    Try doing this work-around. I have implemented it successfully in one of the previous projects.
    Identify one particular destination cell (lets call this cell DEST_CELL here onwards) that is triggering the particular report to open automatically. Now, take a new combo box and use it to insert a blank value in the DEST_CELL everytime DEST_CELL changes its value. Now write a formula in some other cell(lets call is FLAG_CELL) that gives you a "1" when DEST_CELL is not blank and gives you "0" when DEST_CELL is blank. Use this FLAG_CELL to fire the URL. Do not fire URL on change event, fire it when FLAG_CELL is "1".
    Hope this helps you. Do let me know if you need any more/other help.
    Thanks,
    Prasanna

  • Not able to populate data in the combo box

    Hi Guys,
    I m new to flex development and I want to populate the data
    coming from the databasein the combobox.I am able to get the length
    .but not able to populate the data.
    Can anyone helpme out?
    The code is below:
    The data displayed in the combox box is displayed as
    [object],[object] etc.I m sure that the data is coming from the
    database and its not populated in the combo box.any help is
    appreciated.
    private function getParkinfo(event:ResultEvent):void
    { Alert.show(event.result.length.toString());
    countries.dataProvider = event.result;
    <mx:ComboBox id="countries" />

    What does the data look like in the result? Is it XML? Post a
    sample of it.

  • How can I make the combo box turn to the value of black.

    When the show button is pressed (and not before), a filled black square should be
    displayed in the display area. The combo box (or drop down list) that enables the user to choose the colour of
    the displayed shape and the altering should take effect immediately.When the show button is pressed,
    the image should immediately revert to the black square, the combo box should show the value that
    correspond to the black.
    Now ,the problem is: after I pressed show button, the image is reverted to the black square,but I don't know
    how can I make the combo box turn to the value of black.
    Any help or hint?Thanks a lot!
    coding 1.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class test extends JFrame {
         private JPanel buttonPanel;
         private DrawPanel myPanel;
         private JButton showButton;
         private JComboBox colorComboBox;
    private boolean isShow;
         private int shape;
         private boolean isFill=true;
    private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
    "green", "lightgray", "magenta", "orange",
    "pink", "red", "white", "yellow"}; // color names list in ComboBox
    private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public test() {
         super("Draw Shapes");
         // creat custom drawing panel
    myPanel = new DrawPanel(); // instantiate a DrawPanel object
    myPanel.setBackground(Color.white);
         // set up showButton
    // register an event handler for showButton's ActionEvent
    showButton = new JButton ("show");
         showButton.addActionListener(
              // anonymous inner class to handle showButton events
         new ActionListener() {
                   // draw a black filled square shape after clicking showButton
         public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
              // to decide if show the shape
         myPanel.setShowStatus(true);
                   isShow = myPanel.getShowStatus();
                                            shape = DrawPanel.SQUARE;
                        // call DrawPanel method setShape to indicate shape to draw
                                            myPanel.setShape(shape);
                        // call DrawPanel method setFill to indicate to draw a filled shape
                                            myPanel.setFill(true);
                        // call DrawPanel method draw
                                            myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
         );// end call to addActionListener
    // set up colorComboBox
    // register event handlers for colorComboBox's ItemEvent
    colorComboBox = new JComboBox(colorNames);
    colorComboBox.setMaximumRowCount(5);
    colorComboBox.addItemListener(
         // anonymous inner class to handle colorComboBox events
         new ItemListener() {
         // select shape's color
         public void itemStateChanged(ItemEvent event) {
         if(event.getStateChange() == ItemEvent.SELECTED)
         // call DrawPanel method setForeground
         // and pass an element value of colors array
         myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
    myPanel.draw();
    }// end anonymous inner class
    ); // end call to addItemListener
    // set up panel containing buttons
         buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
         buttonPanel.add(showButton);
    buttonPanel.add(colorComboBox);
    JPanel radioButtonPanel = new JPanel();
    radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
    Container container = getContentPane();
    container.setLayout(new BorderLayout(10,10));
    container.add(myPanel, BorderLayout.CENTER);
         container.add(buttonPanel, BorderLayout.EAST);
    setSize(500, 400);
         setVisible(true);
         public static void main(String args[]) {
         test application = new test();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    coding 2
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
    private int shapeSize = 100;
    private Color foreground;
         // draw a specified shape
    public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
    int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
         if (fill == true){
         g.setColor(foreground);
              g.fillOval(x, y, shapeSize, shapeSize);
    else{
                   g.setColor(foreground);
    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
         if (fill == true){
         g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
    else{
                        g.setColor(foreground);
    g.drawRect(x, y, shapeSize, shapeSize);
    // set showStatus value
    public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
    public boolean getShowStatus () {
              return showStatus;
         // set fill value
    public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
    public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
    // set shapeSize value
    public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
    // set foreground value
    public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
    public void draw (){
              if(showStatus == true)
              repaint();

    Hello,
    does setSelectedIndex(int anIndex)
    do what you need?
    See Java Doc for JComboBox.

  • Safari crashes when using the dialog box to import/save files, in facebook under windows 7

    I've encountered the following errors in some PCs, running Safari 5.1.7 in MS-Windows 7 Pro:
    Safari crashes when using the dialog box to import/save files. One doesn't have to actually upload or download any file, the mere invocation of the relevant dialog box brings down all open Safari windows after a couple of seconds.
    Errors displayed in the Event Log are:
    Όνομα ελαττωματικής εφαρμογής Safari.exe, έκδοση 5.34.57.2, χρονική σήμανση 0x4f982b5e
    Όνομα ελαττωματικής λειτουργικής μονάδας CoreGraphics.dll, έκδοση 1.87.0.0, χρονική σήμανση 0x4f9739a0
    Κωδικός εξαίρεσης: 0x40000015
    Μετατόπιση σφάλματος: 0x0013a762
    Αναγνωριστικό ελαττωματικής διεργασίας: 0x17f4
    Χρόνος έναρξης ελαττωματικής εφαρμογής: 0x01cded6b09576023
    Διαδρομή ελαττωματικής εφαρμογής: C:\Program Files\Safari\Safari.exe
    Διαδρομή ελλατωματικής λειτουργικής μονάδας:C:\Program Files\Safari\Apple Application Support\CoreGraphics.dll
    Αναγνωριστικό αναφοράς:ebe64ac9-595e-11e2-a977-0016356671d1
    System
    Provider
    [ Name]
    Application Error
    EventID
    1000
    [ Qualifiers]
    0
    Level
    2
    Task
    100
    Keywords
    0x80000000000000
    TimeCreated
    [ SystemTime]
    2013-01-08T06:45:00.000000000Z
    EventRecordID
    95609
    Channel
    Application
    Computer
    computername
    Security
    EventData
    Safari.exe
    5.34.57.2
    4f982b5e
    CoreGraphics.dll
    1.87.0.0
    4f9739a0
    40000015
    0013a762
    17f4
    01cded6b09576023
    C:\Program Files\Safari\Safari.exe
    C:\Program Files\Safari\Apple Application Support\CoreGraphics.dll
    ebe64ac9-595e-11e2-a977-0016356671d1
    and
    Ελαττωματικός κάδος (bucket) 2970527469, τύπος 1
    Όνομα συμβάντος: APPCRASH
    Απόκριση: Δεν υπάρχει
    Αναγνωριστικό Cab: 0
    Υπογραφή προβλήματος:
    P1: Safari.exe
    P2: 5.34.57.2
    P3: 4f982b5e
    P4: CoreGraphics.dll
    P5: 1.87.0.0
    P6: 4f9739a0
    P7: 40000015
    P8: 0013a762
    P9:
    P10:
    Συνημμένα αρχεία:
    C:\Users\username\AppData\Local\Temp\WER51A.tmp.WERInternalMetadata.xml
    Αυτά τα αρχεία μπορεί να είναι διαθέσιμα εδώ:
    C:\Users\username\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_Saf ari.exe_e273f639ef3d86d52c9d8e15dd2b42dce3e78061_1f86213d
    Σύμβολο ανάλυσης:
    Επανέλεγχος για λύση: 0
    Αναγνωριστικό αναφοράς: ebe64ac9-595e-11e2-a977-0016356671d1
    Κατάσταση αναφοράς: 0
    +
    System
    Provider
    [ Name]
    Windows Error Reporting
    EventID
    1001
    [ Qualifiers]
    0
    Level
    4
    Task
    0
    Keywords
    0x80000000000000
    TimeCreated
    [ SystemTime]
    2013-01-08T06:45:10.000000000Z
    EventRecordID
    95610
    Channel
    Application
    Computer
    computername
    Security
    EventData
    2970527469
    1
    APPCRASH
    Δεν υπάρχει
    0
    Safari.exe
    5.34.57.2
    4f982b5e
    CoreGraphics.dll
    1.87.0.0
    4f9739a0
    40000015
    0013a762
    C:\Users\username\AppData\Local\Temp\WER51A.tmp.WERInternalMetadata.xml
    C:\Users\username\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_Saf ari.exe_e273f639ef3d86d52c9d8e15dd2b42dce3e78061_1f86213d
    0
    ebe64ac9-595e-11e2-a977-0016356671d1
    0
    I have tried in-installing safari but it seems not to help. I have tried installing it to a third, newly installed pc and come to the same result.
    All PCs are fully up-to-date as it regards Microsoft and Apple patches. Any ideas as to why this might happen?

    Still having the same problem. Ever the optimist, I submit the following info.
    Error window screenshot can be found here: https://dl.dropboxusercontent.com/u/22465174/safari/safari_fail_01.JPG
    Enent log entry can be found here: https://dl.dropboxusercontent.com/u/22465174/safari/safari_fail_02.txt
    Version info can be found here: https://dl.dropboxusercontent.com/u/22465174/safari/safari_fail_03.JPG

  • OK so I just made a wireless network and using the apple box or whatever. And I want to change the network name. How do I do that?

    OK so I just made a wireless network and using the apple box or whatever. And I want to change the network name. How do I do that?

    Just want to confirm that I am also having this issue, The connection is fine, and it is in fact charging (@ 100%)
    Everything Rick has said is like an echo to what is happening to me.
    I have tried re-installing iTunes, and restarting the Bonjour service, sadly there is no change.
    earlier before i updated iTunes it recognised my iPod but said that I had to update iTunes in order for it to work.
    So i updated iTunes but now it's not even showing the device anywhere.
    In case this helps:
    OS: Windows 8.1
    iTunes version: 11.3.1.8
    Device: 5th generation iPod touch 16GB with ios 7

Maybe you are looking for

  • Classic Scenanio and Extended Classic Scenario

    Hi all, I would implement on the same system 2 different scenario: 1. Classic Scenario for self service procurement 2. Extended Classic Scenario for the following business scenario:     a. PR from ECC is transfered into Sourcing Cockpit with Plan Dri

  • How to convert a csv file into excel report?

    Hello, I have a csv file, can any body help me how to convert it into an excel report. thanks in advance vakvarma

  • My songs are not saved in music throuh i tools

    my songs are not saved in music throuh i tools

  • Creating Wrapper Packages

    Hi All, Can anybody can we help how to create wrapper packages and where to create it.when we creating the procedures inside the packages and calling them through BPEL interface for fetching records from the database. Provide me if demo link on the a

  • Help with Stock Removal User Exit

    Hello All To control the storage bin selection, I am using the user exit MWMTO004.  When I use the transaction LT03 to create a transfer order the system selects the storage bin selected by me.  However, when I create a transfer order through L_TO_CR