How to disappear the combobox

I try the following code and i got some trouble.
if I select the value in combobox (different value), the combobox will disappear.
But when I select the default value, the combobox will not disappear.
So, how can I disappear the combobox when user select the default value
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableComboBoxByRow extends JFrame
     ArrayList editors = new ArrayList(3);
     public TableComboBoxByRow()
          // Create the editors to be used for each row
          String[] items1 = { "Red", "Blue", "Green" };
          JComboBox comboBox1 = new JComboBox( items1 );
          DefaultCellEditor dce1 = new DefaultCellEditor( comboBox1 );
          editors.add( dce1 );
          String[] items2 = { "Circle", "Square", "Triangle" };
          JComboBox comboBox2 = new JComboBox( items2 );
          DefaultCellEditor dce2 = new DefaultCellEditor( comboBox2 );
          editors.add( dce2 );
          String[] items3 = { "Apple", "Orange", "Banana" };
          JComboBox comboBox3 = new JComboBox( items3 );
          DefaultCellEditor dce3 = new DefaultCellEditor( comboBox3 );
          editors.add( dce3 );
          //  Create the table with default data
          Object[][] data =
               {"Color", "Red"},
               {"Shape", "Square"},
               {"Fruit", "Banana"},
               {"Plain", "Text"}
          String[] columnNames = {"Type","Value"};
          DefaultTableModel model = new DefaultTableModel(data, columnNames);
          JTable table = new JTable(model)
               //  Determine editor to be used by row
               public TableCellEditor getCellEditor(int row, int column)
                    int modelColumn = convertColumnIndexToModel( column );
                    if (modelColumn == 1 && row < 3)
                         return (TableCellEditor)editors.get(row);
                    else
                         return super.getCellEditor(row, column);
          JScrollPane scrollPane = new JScrollPane( table );
          getContentPane().add( scrollPane );
     public static void main(String[] args)
          TableComboBoxByRow frame = new TableComboBoxByRow();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.pack();
          frame.setVisible(true);
}

The following modification seems to work...
          final JTable table = new JTable(model)
          getContentPane().add( scrollPane );
          PopupMenuListener stopEditing = new PopupMenuListener() {
               public void popupMenuWillBecomeVisible( PopupMenuEvent e ) {}
               public void popupMenuWillBecomeInvisible( PopupMenuEvent e ) {
                    TableCellEditor editor = table.getCellEditor();
                    if ( editor != null )
                         editor.stopCellEditing();
               public void popupMenuCanceled( PopupMenuEvent e ) {}
          comboBox1.addPopupMenuListener( stopEditing );
          comboBox2.addPopupMenuListener( stopEditing );
          comboBox3.addPopupMenuListener( stopEditing );          
     }

Similar Messages

  • How to disappear the search help in alv

    hi experts:
       some field's search help in alv appear automaticly,such as bukrs. I want to disappear the search help in ALV.how it come true?
    the alv is CL_GUI_ALV_GRID.
    Edited by: huiqing wei on Apr 20, 2009 10:35 AM

    In the Layout give parameter NO_F4 = 'X'.
    DATA:        wa_layo type lvc_s_layo.
    wa_layo-no_f4 = 'X'.
      call method grid_alv->set_table_for_first_display
        exporting
    *    I_BUFFER_ACTIVE               =
    *    I_BYPASSING_BUFFER            =
    *    I_CONSISTENCY_CHECK           =
    *        i_structure_name              = 'T_MARD'
    *    IS_VARIANT                    =
    *    I_SAVE                        =
          i_default                     = 'X'
        is_layout                     = wa_layo   <<<<<<<<<<<<<<<<<<<<<
    *    IS_PRINT                      =
    *    IT_SPECIAL_GROUPS             =
    *    IT_TOOLBAR_EXCLUDING          =
    *    IT_HYPERLINK                  =
    *    IT_ALV_GRAPHICS               =
    *    IT_EXCEPT_QINFO               =
    *    IR_SALV_ADAPTER               =
        changing
          it_outtab                     = i_mard[]
      it_fieldcatalog               = i_fieldcat[]
    *    IT_SORT                       =
    *    IT_FILTER                     =
    exceptions
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      others                        = 4
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.

  • How to disappear the sub Report if the values are null from db..

    hi.
    i have one requirement ie.
    i put two sub reports at report footer section..
    sub report values are coming from the data base
    Some times  there is no values in data base at sub report two
    plz have a look on below image..it becomes empty.
    can i disappear the sub report if there is no values..
    I need your valuable suggestions..

    Hi
    In your sub reports, you also have to suppress the values (report labels,headings etc) using a formula.
    Go in Report Menu--Section Expert--Suppress -- Formula editor and write the follwoing :
    if Count({Yoursubreportfield)}) > 0 then false else true
    This will suppress your headers and footers or any other secitons which has static information.
    Now in the main report go in section expert and check 'Suppress Blank Sections'
    Also check you have applied New Page before or After for any of your sections.
    --Praveen G

  • How to configure the combobox while using connecting throught the remote URL.

    I am using the combobox in the server for the selection of process stages and is working fine.
    Now I want to connect the combobox through the remote URL connection of my client system. So that it will be updated simultaneously in client and server.
    While connecting through the remote URL it is giving the message the to enter the value property.
    I am not able to understand what value is to be entered in this option.
    Please advise the solution at the earliest.
    Best Regards,
    Naresh Saini

    Dear Poster,
    As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
    Best Regards,
    SDN SRM Moderation Team

  • How to disappear the advertisements

    Already I install some application from apple store like ( wild light) but I keep seeing the advertisements down for other applications it's become noisy
    If there is any way to disappear these advertisements ???

    Yes, but since they are free then the advertisements are how the developer makes money. If you could remove the ads, then the developer couldn't make money from the ads and would have to charge you. Then the app would not be free.
    Many free apps have versions where you can pay for a version without ads.

  • How to make the combobox column in grid can be selectable

    Hi,
    I have a grid in a form and use a SQL query as the data source. Now I want to make a column(a field in a SQL query) to be displayed as combobox and user can select it. I tried to use below code to make the column displayed like a combobox, it seems that the colunn becomes a dropdown box but i can't select it. Also I can't find a way to add valid value and description into this combobox like what I do on a combobox in a form.
    oGrid.Columns.Item("Approved").Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox;
    SAPbouiCOM.GridColumn col = oGrid.Columns.Item("Approved");
    then ???
    Any suggestion?
    Thanks!
    Lan

    Hi Lan
    Try This For Matrix......
    'For Adding Values
      oColumn = oColumns.Add(&quot;Drink&quot;, SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX)
            oColumn.TitleObject.Caption = &quot;Drink&quot;
            oColumn.Width = 100
            'Add Valid Values
            oColumn.ValidValues.Add(&quot;Cola&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;7up&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Fanta&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Orange Juice&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Water&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Lemonade&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Ice Tea&quot;, &quot;&quot;)
            oColumn.ValidValues.Add(&quot;Coffee&quot;, &quot;&quot;)
    'For selected Value
    Dim ocombo As SAPbouiCOM.ComboBox
                Dim oform As SAPbouiCOM.Form
                Dim omat As SAPbouiCOM.Matrix
                oform = SBO_Application.Forms.Item(&quot;MOR1&quot;)
                omat = oform.Items.Item(&quot;mat&quot;).Specific
                ocombo = omat.Columns.Item(&quot;Drink&quot;).Cells.Item(1).Specific
                ocombo.Select(&quot;Fanta&quot;, SAPbouiCOM.BoSearchKey.psk_ByValue)
    Thanks
    Shafi

  • How to shorten the combobox filling time - 12 seconds

    I have a user defined form with 20 comboboxes whose valid values are filled from different tables via Recordset. Recordset queries are quite simple, they just list the code and description of the values in each table.
    But it takes approximately 12 seconds (!!) before all these valid values are filled and form is ready to use (navigate the records etc.)
    Is there any practical solution to shorten this time ?

    <i>I fill these 20 comboboxes programmatically, their content have to be dynamic since I get these values from other tables which are updated by end user. (I add other static valid values directly in XML file of the form.)
    Each combo is filled with approximately 4-5 values now , but it takes 12 seconds till the form is ready to navigate records.
    It makes no sense to wait so long for just one form, but it's a must to fill these combos dynamically.</i>
    <b>Thanks Bill, I'll try your solution.</b>

  • How can recognize the combobox, which is in datagrid.?

    Hi,
        I am developing one sample in WPF, in this sample I placed one combobox in datagrid, now i want to recognize that combobox and select the value from that combobox automatically (in Unit Testing).
    Actually that combobox is visible, while click on "save button", then my data will added to grid and combobox also visible on that time. 
    Regards,
    Bhadram.

    Hi Bhadram,
    Thank you for posting in MSND forum.
    Since this unit test is used to verify whether there have some logic errors in the methods in the C#/ C++ / VB classes and ASP.NET Web Project/ Web Service.
    For more information about this unit test, please refer to it.
    https://msdn.microsoft.com/en-us/library/hh694602.aspx?f=255&MSPPError=-2147217396
    So Unit Test Framework is not suitable for testing UI of WPF applications.
    In addition, I know that since this Coded UI Tests are the recommended approach for testing UI of WPF applications. The coded UI test performs actions on the user interface controls
    for an application and verifies that the correct controls are displayed with the correct values.
    Therefore, I suggest you could try to use the coded UI test to record this
    combobox UI control action and verify the value.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • XML Publisher Report:how to disappear the column if no data found

    Hi,
    I have a XMl publisher report requirement , the format is tabular lets say with the structure of 4 columns and 10 rows.requirement is to if suppose there is no data for row number 6 the row itself should not appear over the report and the immediate next row should come in place.
    please help me if any one of u has implemented the same.
    Ankit

    Ankit,
    This is almost hard to work although NOT impossible to achieve on the template.
    A little big of PL/SQL genius where all the columns are selected into variables may be used to achieve this, although you will have to manage them accordingly.
    I don't any other way round it.
    Rgds

  • How to disappear the border of a table in XML

    Hi,
    I am using an adf table but from xml i am unable to hide the border of that table.
    my code is as below-
    <af:table value="#{bindings.HixEnterPostalCodeVO1.collectionModel}"
    var="row"
    rows="#{bindings.HixEnterPostalCodeVO1.rangeSize}"
    first="#{bindings.HixEnterPostalCodeVO1.rangeStart}"
    width="90%" partialTriggers="CreateRowId1"
    banding="none" bandingInterval="1"
    inlineStyle="border-color:rgb(255,255,255); outline-color:rgb(255,255,255); color:rgb(255,255,255); background-color:rgb(255,255,255); outline-style:none; outline-width:0.0pt; border-style:none; border-width:0.0pt;">
    Can anyone help me in this.
    Thanks,

    I speak better French. So you can translate with google.
    L'astuce que j'utilise est la suivante :
    1 - Extraire les données, un select
    2 - Enregistrer les données dans un fichiers txt ou csv
    3 - ouvrir le fichier avec excel
    4 - créer une colonne à gauche de la colonne contenant les données et écrire INSERT INTO TABLE VALUES (
    5 - dans la colonne de droite écrire *)*
    6 - enregistrer et tu as ton script pour transférer les données dans une autre BD.
    Bonne chance.

  • How to change the combobox's border width

    Hi all,
    I am using JDeveloper 11.1.1.1.0 and ADF Faces.I want to change the border width of combo box.I tried to apply " border-width:0.0px; " in content style and inLine style.But no hope.
    <af:selectOneChoice label="Label 1" id="soc2"
    contentStyle="border-width:0.0px;">
    <f:selectItems value="#{Temp.superintendent}" id="si2"/>
    </af:selectOneChoice>
    Edited by: Dinil Mithra on Oct 16, 2009 2:44 AM

    Hi,
    a skin for this is
    af|inputComboboxListOfValues{
    border-style: solid;
    border-width: 0px;
    If you want to get rid of the inner border, you use
    af|inputComboboxListOfValues::container,
    af|inputComboboxListOfValues::content,
    af|inputComboboxListOfValues::dropdown-cell{
    border-width: 0px;
    Frank

  • In adobe form, how to disappear the part as the picture shows?

    Could someone give me a hint please? Thanks in advance.

    Hi Kenny,
    Firstly you should use ZCI (Native) forms and NOT ActiveX enabled forms. Also enable Javascript in your browser as rightly pointed by Custodio.
    Regards,
    Nikhil

  • How to load the content in Combobox

    Dear All,
       Any one can tell me how to load the combobox dynamically..  i have one combobox in that i defined the value as "Defined New" when i click the DefineNew a new form wil come i wil enter the value in the editext. when i click the combobox the value should display.. i have done  this, its working fine but  the problem is every time when i add the value it wil show the data in the  the form Load.. i want data should come dynamically..
    any one can help me in this regard
    G.shankar

    You can use this "oForm.Refresh()" every time you add a new valid value to the ComboBox.
    I hope this help you.
    Regards.
    Enriquillo Guigni

  • How to get the values of 2 dynamic comboboxes in one jsp to another jsp?

    I have 2 comboboxes and one submit button on my jsp page.I select a value in 1st combobox then the values in the second combobox populated from the database. next i select 2nd combobox and then submit the button.After submit the button call the next jsp page. In that page i want to display the values of two comboboxes. but my problem is , in that page only 2nd combobox value is displayed.1st combobox is displayed as null. plz tell me, how to get the values of two comboboxes at a time?
    Select.jsp:
    <%@ page language="java" import="java.sql.*" %>
    <%!
         Connection con = null;
         Statement  st  = null;
         ResultSet  rs  = null;
         String     sql = null;
         void addItems(javax.servlet.jsp.JspWriter out, String sql)
           try{     
              rs = st.executeQuery(sql);
              while( rs.next() )
                   out.println("<option>" + rs.getString(1) + "</option>");               
         }catch(Exception e)
                   System.out.println(e);
    %>
    <HTML>
    <HEAD>
    <TITLE>JSP WITH  MULTIPLE FORMS</TITLE>
    <script language="javascript">
              function checking()
                        form1.submit();
         </script>
    </HEAD>
         <body>
             <center>
             <b><font size="5" color="#333399">Staff ID:</font></b></center>
                     <FORM NAME="form1" METHOD="POST" ACTION="Select.jsp">
                         <p align=center>
                         Details of Staff :  
                       <SELECT 1 NAME="type" onchange="checking();">
                                    <option> Administrator </option>
                              <option> OfficeAssistent </option>
                              <option> Clerk </option>
                                  </SELECT 1>
                          </p>
    </FORM>
                      <FORM NAME="form2" METHOD="POST" action="welcome1.jsp">
                      <center>
                          <TABLE><TR><TD>Staff ID:</TD>
                                 <TD><SELECT 2 NAME="staff_id">
                    <%    
            String type = request.getParameter("type");
            try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            con = DriverManager.getConnection("jdbc:odbc:java","system","manager");
            catch (ClassNotFoundException ex) {
                   System.out.println(ex);
            catch (SQLException ex)
                System.out.println(ex);
         st  = con.createStatement();
         sql = "select staff_id from "+type+"";
         addItems(out, sql);
    %>
              </SELECT 2>
           </TD>
         </TR>
    </table></center>
    <h2> Details of <%= type + "s" %> </h2>
                         <center><input type=submit value=ok onclick="submit();"></center>
                  </FORM>
         </BODY>
    </HTML>
    welcome1.jsp
    <center><h1>WEL COME</h1></center>
    <%    
            String type = request.getParameter("type");
            String sid = request.getParameter("staff_id");
    %>
    <h2> Details of <%= type + "s" %> </h2>
    <h2> Details of <%= sid %> </h2>

    <SELECT 1 NAME="type" onchange="checking();">
                                    <option value = "0"> Administrator </option>
                              <option value = "1"> OfficeAssistent </option>
                              <option value = "2"> Clerk </option>
                                  </SELECT 1>

  • How to get the selectedIndex from a combobox made by classFactory?

    Dear All,
    I am trying to get the selectedIndex or selecetedItem.banda_id when changing a combobox that is created by classFactory and it is inside a datagrid.
    The code I have is:
    MXML:
    <mx:DataGrid width="100%" height="100%" id="salas_fin_dg" editable="true">
         <mx:columns>
    <mx:DataGridColumn headerText="Titulo" dataField="titulo" editable="false" width="250"/>
    <mx:DataGridColumn headerText="Data" dataField="start_dt" editable="false"/>
    <mx:DataGridColumn headerText="Dur" dataField="duration" editable="false" width="40"/>
    <mx:DataGridColumn headerText="Banda" dataField="banda_nome" editable="true" itemEditor="{combofac}"/>
    <mx:DataGridColumn headerText="$ Ensaio" dataField="total_ensaio" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Bar" dataField="total_bar" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Loja" dataField="total_loja" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ CC" dataField="total_cc" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ CH" dataField="total_ch" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ DI" dataField="total_di" editable="true" itemEditor="controls.NumericInput"/>
    <mx:DataGridColumn headerText="$ Pend" dataField="total_pend" editable="true" itemEditor="controls.NumericInput"/>
         </mx:columns>
    </mx:DataGrid>
    Script:
    private function getSalasFinHandler(event:ResultEvent):void
    salas_fin_lst = new ArrayCollection(event.result as Array);
    salas_fin_dg.dataProvider = salas_fin_lst;
    myservice.getBandas();
    combofac=new ClassFactory(ComboBox);
         combofac.properties={dataProvider:bandas_lst, labelField:"banda_nome", prompt:"Selecione"};
    I am using Remote Object to get the data from a DB, and it is working properly.
    As I will update the datagrid cell values, I would like to update them on the DB.
    In order to do that, I would need to access the banda_id value, that is part of the combofac dataprovider, I mean that this dataprovider has 2 columns, being banda_nome and banda_id.
    The question is how to get the banda_id value, when I change the comobobox?
    Many thanks in advance,
    Gines

    Dear harUI and kolinitcom,
    Thanks for the your prompt response and guidelines.
    I went to research a little bit more on the itemEditEnd and found a way to access the data inside the combobox.
    The code for all application goes below. If you click on the button, it will show you all the datagrid data, plus the ID of the combobox when changed.
    Thanks again,
    Gines
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout="vertical"
            verticalAlign="middle"
            backgroundColor="white" initialize="init();">
            <mx:Script>
               <![CDATA[
               import mx.utils.ObjectUtil;
               import mx.controls.ComboBox;
               import mx.controls.Alert;
               import mx.events.DataGridEvent;
               import mx.events.*;
          [Bindable]
          private var combofac:ClassFactory;
      public var newVal:String;
          private function init():void
            combofac=new ClassFactory(mx.controls.ComboBox);
            combofac.properties={dataProvider:arrcombo, prompt:"Selecione", labelField:"label"};      
                public function getCellInfo(event:DataGridEvent):void {
                    var myEditor:ComboBox = ComboBox(event.currentTarget.itemEditorInstance);
                    newVal = myEditor.selectedItem.data;
    public function mostra():void
    var dados:Object = new Object;
    dados.nome = dataGrid.selectedItem.label;
    dados.score = dataGrid.selectedItem.score;
    dados.score_id = newVal;
    Alert.show(ObjectUtil.toString(dados));
           ]]>
        </mx:Script>
        <mx:TextArea id="cellInfo" width="300" height="150" />
                <mx:ArrayCollection id="arrcombo">
            <mx:source>
                <mx:Array>
                    <mx:Object label="1" data="A1"/>
                    <mx:Object label="2" data="A2"/>
                    <mx:Object label="3" data="A3"/>
                    <mx:Object label="4" data="A4"/>
                    <mx:Object label="5" data="A5"/>
                    <mx:Object label="6" data="A6"/>
                    <mx:Object label="7" data="A7"/>
                    <mx:Object label="8" data="A8"/>
                    <mx:Object label="9" data="A9"/>
                </mx:Array>
            </mx:source>
        </mx:ArrayCollection>
        <mx:ArrayCollection id="arrColl">
            <mx:source>
                <mx:Array>
                    <mx:Object label="Student A" score="8" />
                    <mx:Object label="Student B" score="4" />
                    <mx:Object label="Student C" score="7" />
                    <mx:Object label="Student D" score="8" />
                    <mx:Object label="Student E" score="2" />
                    <mx:Object label="Student F" score="6" />
                    <mx:Object label="Student G" score="7" />
                    <mx:Object label="Student H" score="7" />
                    <mx:Object label="Student I" score="9" />
                    <mx:Object label="Student J" score="8" />
                    <mx:Object label="Student K" score="4" />
                    <mx:Object label="Student L" score="7" />
                </mx:Array>
            </mx:source>
        </mx:ArrayCollection>
        <mx:DataGrid id="dataGrid"
                dataProvider="{arrColl}"
                editable="true"
                rowCount="8"
                itemEditEnd="getCellInfo(event);">
            <mx:columns>
                <mx:DataGridColumn dataField="label"
                        editable="false" />
                <mx:DataGridColumn dataField="score"
                        editable="true"
                        itemEditor="{combofac}"/>
    <mx:DataGridColumn headerText="Salvar" width="50">
    <mx:itemRenderer>
    <mx:Component>
    <mx:VBox width="100%" height="100%">
    <mx:Button label="See the values" click="outerDocument.mostra();"/>
    </mx:VBox>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>

Maybe you are looking for

  • How to fit 4 1/2 hours onto a DVD

    OK i dont get it. Because It says that a standard DVD fits 4.7 GBs on a DVD. So when I finished my project with FCP. I exported using QT conversion. I exported my file as an MP4 using H.264. and got my 4 1/2 hour project down to 2.4 GBs. But when I t

  • WRT54G3G-ST and DDNS

    I am attempting to use the DDNS feature in the WRT54G3G-ST. It appears to be working but I cannot access camera from outside my LAN. If I tracert to the ddns domain name it correctly pulls up the correct IP address but seems to fail when it reaches t

  • OFM 11.1.1.4 trying to write into jacob.dll, d2kwut60.dll and JNIsharedstubs.dll when these are being used by 10gAS

    Hi All, We are working on a 10g Application Server to Oracle Fusion Middleware upgrade project. We currently have more than one application in the 10gAS and the upgrade to OFM is being done one at a time. So, until all the applications gets upgraded

  • Call function module in update task

    Hi I am using the follwoing logic in my prog CALL FUNCTION 'Z_Update _Task'    In update task   EXPORTING     t_vbak        =  t_vbak. But the program goes to dump at call function Please let me know if the syntax i am using is correct. Edited by: ki

  • Why does my system currency Aging Summery in my Query  not tie to the BP aging in System Currency

    This query works but why does the amount not tie by account in System Currency from the BP. The amounts are off slightly and I am wondering if I am missing something in my query. This same query in local currency ties to the BP but when I did it in U