WARNING: ADFv: Could not find selected item matching value ...

Using Windows JDev 11.1; I have an entity object with an attribute which has a LOV configured to supply a select-one-choice render. The LOV query requires that a bind variable be supplied. When creating a new record in the entity via the VO, I can use the ViewImpl to create a new row, retrieve the RowSet which corresponds to the attribute LOV query, set the named where clause parameter, and I'm away. When updating however, I'm getting the following error reported:
09/12/2009 2:44:04 PM oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding getInputValue
WARNING: ADFv: Could not find selected item matching value EMPLOYER of type: java.lang.String in the list-of-values.
I can't supply the bind variable value before the row is instantiated (and presumably populated with the current value/key) because the View Accessor RowSet is only accessible via the RowImpl. If after the query has executed, I apply the bind variable value, re-execute the RowSet query, I can see that it's populated, and I can create a RowSetIterator to loop through the LOV RowSet and confirm that the key/value is there. I can even setCurrentRow on the RowSet but I still find that the above error appears in the serve log output seemingly after all this code executes.
So my question is what is the technique for supplying bind variables to attribute LOV View Accessors as part of an underlying EO object query.
In the run-time, the list items appear unpopulated (current value and list items). If I reload the page, it all comes up fine, which could tend to suggest that a PPR event might fix me up, but I would prefer to know how this should be done.
Thanks in advance.
Edited by: robli on Dec 9, 2009 9:01 PM

Hi,
Is your issue resolved. I'm facing similar issue. I have created a viewaAccessors in EO, associated these to ViewObject attributes as List of Values.
I created the table in UI using the ViewObject.
I see those as selectOneChoice but not values (Empty list).
If I create new record in the table by CreateInsert. table now shows the ListOfvalues.
any Idea what am I missing.
Thanks,
Satya
Edited by: stammine on Mar 2, 2010 4:09 PM

Similar Messages

  • Could not find selected item matching value "New" warning message in ADF

    Hi,
    I have a selectOneChoice1 for a field which has the following fixed values in it. And while creating it, I selected the 'SelctionRequired' option so that this field will always have a value.
    New
    Pending
    Completed.
    While navigating to this page, I am trying to set the value to 'New' (Retrieved from the DB) in the backing bean. But when the page is rendered, the above field is empty with the above options in the list and jdev has the follwing error message in its log.
    WARNING: Could not find selected item matching value "New" in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=selectOneChoice1]
    Can any one help me with this issue?
    Thanks,
    Priya

    The value of a list binding is the zero-based integer position in the list that is selected, not the actual underlying value.
    The simplest way to set the value of an attribute is to use an attribute binding (which can be bound to the same attribute as the list binding). When you set the value of an attribute binding, it sets the value as you supply it. Otherwise, you'd need to set the list binding's value to the numerical "slot" number of the one you want to change the value to.

  • Could not find selected item matching value "null" in CoreSelectOneRadio

    Hello,
    I get the following error with my selectOneChoice components:
    WARNING Could not find selected item matching value "null" in CoreSelectOneRadio[UIXEditableFacesBeanImpl, id=dyna_2709976_11]
    It seem that the component looks for a selectItem object qith its value set to null, so I tried to add one with a null value to no avail. The error don't cause any problem on the rendered page but it might spam the log when many users will be connected. Anyone every got this error and found a fix to stop it from appearing?
    Regards,
    Simon Lessard

    you said you're using selectOneChoice but the error says radio. Is the information correct?

  • Could not find selected item in LOV

    hi i follow this sample http://www.scribd.com/doc/2633296/ADF-Learning-6-Dependent-List-Boxes ,but when i select my LOV am geting this error FacesCtrlListBinding> <getInputValue> ADFv: Could not find selected item matching value 100 of type: oracle.jbo.domain.Number in the list-of-values.
    am in jdeveloper 11.1.1.6.0

    the data type am selecting is number but displaying employee name my page is,the value 100 is the employeeid is in db
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:messages id="m1"/>
          <af:form id="f1">
            <af:panelHeader text="panelHeader 1" id="ph1">
              <f:facet name="context"/>
              <f:facet name="menuBar"/>
              <f:facet name="toolbar">
                <af:commandButton actionListener="#{bindings.CreateInsert.execute}"
                                  text="CreateInsert"
                                  id="cb1"/>
              </f:facet>
              <f:facet name="legend"/>
              <f:facet name="info"/>
              <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.DepartmentId.inputValue}"
                              label="#{bindings.DepartmentId.hints.label}"
                              required="#{bindings.DepartmentId.hints.mandatory}"
                              columns="#{bindings.DepartmentId.hints.displayWidth}"
                              maximumLength="#{bindings.DepartmentId.hints.precision}"
                              shortDesc="#{bindings.DepartmentId.hints.tooltip}"
                              id="it1" rendered="false">
                  <f:validator binding="#{bindings.DepartmentId.validator}"/>
                  <af:convertNumber groupingUsed="false"
                                    pattern="#{bindings.DepartmentId.format}"/>
                </af:inputText>
                <af:inputText value="#{bindings.EmployeeId.inputValue}"
                              label="#{bindings.EmployeeId.hints.label}"
                              required="#{bindings.EmployeeId.hints.mandatory}"
                              columns="#{bindings.EmployeeId.hints.displayWidth}"
                              maximumLength="#{bindings.EmployeeId.hints.precision}"
                              shortDesc="#{bindings.EmployeeId.hints.tooltip}"
                              id="it3" rendered="false">
                  <f:validator binding="#{bindings.EmployeeId.validator}"/>
                  <af:convertNumber groupingUsed="false"
                                    pattern="#{bindings.EmployeeId.format}"/>
                </af:inputText>
                <af:inputText value="#{bindings.Password.inputValue}"
                              label="#{bindings.Password.hints.label}"
                              required="#{bindings.Password.hints.mandatory}"
                              columns="#{bindings.Password.hints.displayWidth}"
                              maximumLength="#{bindings.Password.hints.precision}"
                              shortDesc="#{bindings.Password.hints.tooltip}"
                              id="it4">
                  <f:validator binding="#{bindings.Password.validator}"/>
                </af:inputText>
                <af:inputText value="#{bindings.UserId.inputValue}"
                              label="#{bindings.UserId.hints.label}"
                              required="#{bindings.UserId.hints.mandatory}"
                              columns="#{bindings.UserId.hints.displayWidth}"
                              maximumLength="#{bindings.UserId.hints.precision}"
                              shortDesc="#{bindings.UserId.hints.tooltip}" id="it2">
                  <f:validator binding="#{bindings.UserId.validator}"/>
                </af:inputText>
                <af:selectOneChoice value="#{bindings.DepartmentId1.inputValue}"
                                    label="#{bindings.DepartmentId1.label}"
                                    required="#{bindings.DepartmentId1.hints.mandatory}"
                                    shortDesc="#{bindings.DepartmentId1.hints.tooltip}"
                                    id="soc1" autoSubmit="true">
                  <f:selectItems value="#{bindings.DepartmentId1.items}" id="si1"/>
                </af:selectOneChoice>
                <af:selectOneChoice value="#{bindings.EmployeeId1.inputValue}"
                                    label="#{bindings.EmployeeId1.label}"
                                    required="#{bindings.EmployeeId1.hints.mandatory}"
                                    shortDesc="#{bindings.EmployeeId1.hints.tooltip}"
                                    id="soc2" partialTriggers="soc1">
                  <f:selectItems value="#{bindings.EmployeeId1.items}" id="si2"/>
                </af:selectOneChoice>
              </af:panelFormLayout>
            </af:panelHeader>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>my view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="VikUserViewObj"
      Version="11.1.1.61.92"
      InheritPersonalization="true"
      SelectList="VikUser.DEPARTMENT_ID,
           VikUser.EMPLOYEE_ID,
           VikUser.PASSWORD,
           VikUser.USER_ID"
      FromList="VIKUSER VikUser"
      BindingStyle="OracleName"
      CustomQuery="false"
      PageIterMode="Full"
      UseGlueCode="false">
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="model.VikUserViewObj_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <EntityUsage
        Name="VikUser"
        Entity="model.VikUser"/>
      <ViewAttribute
        Name="DepartmentId"
        IsNotNull="true"
        PrecisionRule="true"
        EntityAttrName="DepartmentId"
        EntityUsage="VikUser"
        AliasName="DEPARTMENT_ID"/>
      <ViewAttribute
        Name="EmployeeId"
        IsNotNull="true"
        PrecisionRule="true"
        EntityAttrName="EmployeeId"
        EntityUsage="VikUser"
        AliasName="EMPLOYEE_ID"/>
      <ViewAttribute
        Name="Password"
        PrecisionRule="true"
        EntityAttrName="Password"
        EntityUsage="VikUser"
        AliasName="PASSWORD"/>
      <ViewAttribute
        Name="UserId"
        PrecisionRule="true"
        EntityAttrName="UserId"
        EntityUsage="VikUser"
        AliasName="USER_ID"/>
      <ResourceBundle>
        <PropertiesBundle
          PropertiesFile="model.ModelBundle"/>
      </ResourceBundle>
    </ViewObject>Edited by: user0994 on 2012/10/20 9:07 PM
    Edited by: user0994 on 2012/10/20 9:29 PM
    Edited by: user0994 on 2012/10/20 10:41 PM

  • 11.1.1.4:Could not find the item selected to match the value of type Number

    Hi,
    I have a taskflow with an input parameter.
    The input parameter value is to be assigned to a list item as the default selected value.
    I have mapped the pageFlow scope parameter to set value to the list item using input page parameters defined in task flow.
    but When i Run the task flow the value does not get assigned to the drop down list and jdevloper console screen shows up the following message
    "Could not find the item selected to match the value 2 by type: oracle.jbo.domain.Number in LOV."
    But If I click the Lov to check the values it shows that value is present in the list.
    The same configurations works if the list of values is for a column with type as java.lang.String.
    Is it somethng different that is to be done for a Number field to assign value from a taskflow parameter?
    Edited by: user3067156 on Jun 25, 2011 3:34 PM

    Hi Jobinesh,
    I am assigning the default value in the task flow using input page parameters ...
    <view id="VIEW1">
    <page>/title.jsff</page>
    <input-page-parameter>
    <from-value>#{pageFlowScope.pInputTyp_Id}</from-value>
    <to-value>#{bindings.pTyp_Id1.attributeValue}</to-value>
    </input-page-parameter>
    </view id>
    It does not assign the value, if Bind variable(pTyp_Id1) NDtype and task flow input parameter(pInputTyp) class type, both are set to use type oracle.jbo.domain.Number.
    If I change both to use java.lang.String and additionally also change the VO defination the accept the bind variable of type string, it assigns the value correctly.
    Usecase:
    I have a a task flow for which has its first page a search page.
    The Search page is created using operation execute with params and dragging the query parameters on the page.
    The Query parameters are to be filled using a select one choice option and the list is bound to the master values.
    This task flow can be used inside a standalone page as a region to provide a search page
    The same task flow can be called from within another taskflow which will provide the default values for the drop down lists ..
    Since the search page is a jsff fragment i dont have a page on load handler to provide default values..
    So assiging the values using input page parameters defined in task flow view tag.
    For testing I am passing the taskflow input parameters by calling the task flow from a jspx page a region . When I configure this task flow a region in a page its asks for providing the values for the parameters
    And the same gets configured in my testpage def as
    <executables>
    <variableIterator id="variables"/>
    <taskFlow id="Flow1" taskFlowId="/WEB-INF/Flow1.xml#Flow1"
    activation="deferred"
    xmlns="http://xmlns.oracle.com/adf/controller/binding">
    <parameters>
    <parameter id="pTyp_Id" value="1207"/>
    </parameters>
    </taskFlow>
    </executables>
    Edited by: user3067156 on Jun 27, 2011 1:50 PM

  • Error when deleting file: Could not find this item. This is no longer located in ...

    We are setting up a new Windows 2012 server. Users access this server using a 'terminal services'. We have mapped some folders from a legacy server (different domain). Using group policy preferences, we map this folder as a drive for a user.
    When user wants to delete some files, he get's the error: 'Could not find this item ..' The error is displayed to the user and it looks like the file can't be deleted. But when I press the F5 (refresh) button, the file is gone. My problem is very similar
    to a problem in the following post: http://social.technet.microsoft.com/Forums/windowsserver/en-US/042e747a-0e25-4190-b0a2-82f3e9635eb0/can-not-delete-file-error-is-could-not-find-this-item?forum=w7itprogeneral
    When I create 'txt' (or 'pdf', 'zip') file, i can delete it without the error. When I create 'xlsx', 'docx', 'pptx', 'bmp', 'jpg', I get the error.
    Does somebody have an idea, how can I fix the cause of this problem? (I can't tell to users to hit the F5 button everytime when they face this issue)
    Thank you for your help in advance!
    Juraj

    Hi,
    Please check if the problematic files’ filename ended with a dot. If so, you could refer to the article below to troubleshoot the issue:
    Solved: “Cannot read from the source file or disk”
    http://blog.dotsmart.net/2008/06/12/solved-cannot-read-from-the-source-file-or-disk/
    Regards,
    Mandy
    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.

  • Unable to Delete Folder, Could not find this item

    Currently, I'm having problem deleting an old Folder. Previously, I used its parent as a shared folder, but one day when I tried to clear that folder there is one folder that has duplicate. The problem is one of them (the old one) can't be deleted even after
    I deleted all files/folders in that folder, I can't remove/rename that folder (could not find this item) not even with cmd as Administrator. I've tried to defrag my Windows Sever 2012 but the problem still persists. How to fix this problem?
    Thanks in advance.

    I had this same problem using Server 2012 Std. I tried various options of taking ownership of the parent folder because the Security properties of the folder I was trying to delete were blank, using CMD and Dir /x etc. I even tried sharing
    the parent folder and then using Server 2008 R2. None of them worked. When I tried Dir /x Server 2012 doesn't show the 8 character filename with the ~1. I tried typing it in myself, but that didn't work either. I then found that there was a space at the end
    of the folder name. I then tried all the CMD options again using a space, still no luck. Then I finally stumbled upon this solution:
    Open CMD and then type:
    rd /s "\\?\D:\bad\folder\path "
    example: rd /s "\\?\D:\Sharedata\folder1\folder2 " - note the space after folder2 as per the space in the folder name. Obviously D: is the drive that has the folder on it.
    This worked for me
    I've had a similar problem as detailed above; a power shell script that I wrote incorrectly tested for the existence of a directory and created multiple instances of the same directory.
    I can confirm that the post from Rayza73 works like a charm!
    @Rayza73:  First up thanks for the information.  Would it be possible for you to describe how the command is able to find and delete the directory?
    Many thanks
    Shaun

  • FQDN Share Access (Could not find this item)

    Say I have the domain 'contoso.com', which is resolved by a domain controller (Controller). I have a share (Share) on Controller with everyone permissions (full control, just to test).
    Now I can access Share via '\\Controller\Share' or '\\Controller.contoso.com\Share'. This is fine.
    I can also access Share via '\\contoso.com\Share'. This is not fine, as follows.
    If I try to e.g. create a new folder, I get 'Could not find this item. This is no longer located in contoso.com.'
    Why is Share listed in the shares of contoso.com if it isn't located there?

    Hi,
    Do you mean that you can access Share via '\\Controller\Share' or '\\Controller.contoso.com\Share' and create a new folder in it without issue, however, you cannot create a new folder in the Share folder when access share via '\\contoso.com\Share'?
    I have done a test on my PC, when access share via '\\contoso.com\Share' the content is empty. I create a new folder in it, then I have a same issue with you. It seems that it is a side effect of having shared folders on a domain controller.
    Domain.local shows shares but are empty
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/57d2120c-46c7-430e-9d3e-3d589a02dde2/domainlocal-shows-shares-but-are-empty?forum=winserveressentials
    Regards,
    Mandy
    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.

  • File Share.Could not find the item, this item is no longer here, check the location and try again

    Hi all, I have a failover cluster Wiindows 2012 R2 server with file server.
    A few days ago, when users try to rename folders and the following error can not be appearing:
    "Could not find the item, this item is no longer here, check the location and try again"
    When I enter as a domain administrator, I can rename the directory.
    Do you know that you can be?
    regards
    Microsoft Certified IT Professional Server Administrator

    Good afternoon,
    and this solved it was a problem with
    Windows 7 and Windows Vista
    computers, a registry key that affects the
    Explorer process is corrupted.
    This registry key is ejcuta and
    solves:
    FolderDescriptions x86.reg
    greetings To Your
    Microsoft Certified IT Professional Server Administrator

  • "could not find this item"

    I have a snow server resharing a folder on an xsan volume via AFP and SMB.
    Windows 7 clients trying to copy files from the share are getting the error "could not find this item" "This is no longer located in... Verify the item's location and try again."
    Any ideas?

    https://discussions.apple.com/thread/2249820?start=0&tstart=0 had my resolution

  • Can not delete file. Error is "Could not find this item".

    I get the following error when trying to delete a file:  "Item not found".  This is a Word 2007 document that would not save properly so I saved it with a different name.  Now I can't delete the original file.
    The body of the error states "Could not find this item.  This is no longer located in... . Verify the item's location and try again.

    Hi,
    I'm having exact the same problem with a file with a long name, to delete, move, rename, attribute change, etc. I deleted the file, which I receive the confirmation. However, the file is still there, with zero bytes and no extension. When I try
    to delet, move or change the file, I get the error "Could not find this item, This is no longer located in xxx. Verify the item's location and try again."
    I tryed everything: Using DOS, there's no 8.3 name format; In safe mode; chkdsk and sfc. Nothing worked.
    I also tryed the tricks in http://www.sevenforums.com/general-discussion/27924-could-not-find-item-when-deleting-files-3.html
    http://forums.techarena.in/vista-help/1038943.htm
    Without success.
    I took some more time and found this tool on the net "DelinvFile". It works perfectly, after trying EVERYTHING!!!.
    I Have Windows 7 professional 64bits and NTFS.
    Thank you very much.
    Thankyou Thankyou Thankyou Thankyou......... We are almost bald tearing our hair out over this issue and how to fix it.     Delin File WORKS...... At the cost of about 28 bucks well worth it.............. Good onya mate............

  • While transfering to flash drive I get this message Could not find this item,no longer located in I:

    Hp touchscreen model #310-1125y

    Hi,
    This is an Explorer error, please use the following methods to fix:
        http://answers.microsoft.com/en-us/windows/forum/windows_7-files/error-could-not-find-this-item-this...
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Warning: Could not find the customization level value for document

    Hi All,
    I am trying to upload the translation for one of the page at responsibility level.
    I am getting following warning when running the below command.
    java oracle.jrad.tools.trans.imp.XLIFFImporter $APPL_TOP/xmci/12.0.0/fr-CA/Translated/ARIACCTDETAILSPAGE.xlf -username apps -password apps -dbconnection "$AD_APPS_JDBC_URL"
    Warning: Could not find the customization level value for document "/oracle/apps/ar/irec/accountDetails/webui/customizations/responsibility/51688/ARIACCTDETAILSPAGE".
    The same is working fine if the translation is for some attribute at site or function level.
    Did anyone faced this kind of issue.
    Thanks,
    Anoop

    Anoop,
    I am sure you would have verified the responsibility id in the target instance is 51688(may be source instance your resp id is 51688 and in target it is different).
    Have a look at this below notes, it might help.
    1077267.1 - Unable To Move Resp Level OA Personalization From 1 Env To Another
    848851.1 - Attempting To Upload XML File Generates Error: Could not find the customization level value for document
    Thanks.
    With Regards,
    Kali.
    OSSI.

  • Warning Messages - Could not find schema information for the element applicationSettings - App.Config of a console app

    This is my app.config file
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
            <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
                <section name="IntelBrandFX.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
            </sectionGroup>
        </configSections>
      <appSettings>
        <add key="connStr" value="Data Source=tmvnasql1.tmvn.com;Initial Catalog=brandplan;Integrated Security=True"/>
      </appSettings>
      <applicationSettings>
        <IntelBrandFX.Properties.Settings>
          <setting name="IntelBrandFX_rollupViewerService_extract" serializeAs="String">
            <value>https://viewer.rollup.com/omdsp2008/extract.asmx</value>
          </setting>
        </IntelBrandFX.Properties.Settings>
      </applicationSettings>
    </configuration>
    And the Warning messages  are
    Message 1 Could not find schema information for the element 'applicationSettings'.
    Message 2 Could not find schema information for the element 'IntelBrandFX.Properties.Settings'.
    Message 3 Could not find schema information for the element 'setting'.
    Message 4 Could not find schema information for the attribute 'name'.
    Message 5 Could not find schema information for the attribute 'serializeAs'.
    Message 6 Could not find schema information for the element 'value'.
    Althought they do no hinder me from successfully running the project. these messages are annoying. I have seen many articles on the web but could nowhere find the exact schemas for that the above elements that I could add to the  DotNetConfig.xsd file.
    Could somebody give me an idea how to create xsds for the elements above and include in the dotnetConfig.xsd.
    I understand what needs to be done but not sure of the exact way to do it.
    Thanks,

    You don't need to modify the dotnetconfig.xsd.  All you need to do is generate an XSD for your section and let VS know where it is at.
    1) Create your XSD using any of the various tools available or by hand.
    2) Copy your XSD into the <VSDir>\Xml\Schemas directory.
    3) Create a catalog file for your schema.
    4) Restart VS and it'll load the XSD and give you Intellisense.
    Here's the MSDN documentation for it: http://msdn.microsoft.com/en-us/library/ms255821.aspx
    Michael Taylor - 8/18/09
    http://p3net.mvps.org

  • Could not find main class!

    I tried some code I got from a book I recently bought it compiled ok but when I tried to run it in JPadPro I got the Java Virtual Machine Launcher warning saying 'Could not find the main class. Program will exit!' As far as I can see there is a main method so I am not to sure what the actual problem is. I pasted the code below hopefully someone can help, Dave.
    * Copyright (c) 2000 David Flanagan.  All rights reserved.
    * This code is from the book Java Examples in a Nutshell, 2nd Edition.
    * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
    * You may study, use, and modify it for any non-commercial purpose.
    * You may distribute it non-commercially as long as you retain this notice.
    * For a commercial use license, or to purchase the book (recommended),
    * visit http://www.davidflanagan.com/javaexamples2.
    package com.davidflanagan.examples.datatransfer;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    * This program demonstrates how to add simple copy-and-paste capabilities
    * to an application.
    public class SimpleCutAndPaste extends Frame implements ClipboardOwner
        /** The main method creates a frame and pops it up. */
        public static void main(String[] args) {
         Frame f = new SimpleCutAndPaste();
         f.addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) { System.exit(0); }
         f.pack();
         f.setVisible(true);
        /** The text field that holds the text that is cut or pasted */
        TextField field;
         * The constructor builds a very simple test GUI, and registers this object
         * as the ActionListener for the buttons
        public SimpleCutAndPaste() {
         super("SimpleCutAndPaste");  // Window title
         this.setFont(new Font("SansSerif", Font.PLAIN, 18)); // Use a big font
         // Set up the Cut button
         Button copy = new Button("Copy");                      
         copy.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) { copy(); }
         this.add(copy, "West");
         // Set up the Paste button
         Button paste = new Button("Paste");
         paste.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) { paste(); }
         this.add(paste, "East");
         // Set up the text field that they both operate on
         field = new TextField();
         this.add(field, "North");
         * This method takes the current contents of the text field, creates a
         * StringSelection object to represent that string, and puts the
         * StringSelection onto the clipboard
        public void copy() {
         // Get the currently displayed value
         String s = field.getText();                 
         // Create a StringSelection object to represent the text.
         // StringSelection is a pre-defined class that implements
         // Transferable and ClipboardOwner for us.
         StringSelection ss = new StringSelection(s);
         // Now set the StringSelection object as the contents of the clipboard
         // Also specify that we're the clipboard owner
         this.getToolkit().getSystemClipboard().setContents(ss, this);
         // Highlight the text to indicate it is on the clipboard.
         field.selectAll();
         * Get the contents of the clipboard, and, if we understand the type,
         * display the contents.  This method understands strings and file lists.
        public void paste() {
         // Get the clipboard
         Clipboard c = this.getToolkit().getSystemClipboard();
         // Get the contents of the clipboard, as a Transferable object
         Transferable t = c.getContents(this);
         // Find out what kind of data is on the clipboard
         try {
             if (t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
              // If it is a string, then get and display the string
              String s = (String) t.getTransferData(DataFlavor.stringFlavor);
              field.setText(s);
             else if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
              // If it is a list of File objects, get the list and display
              // the name of the first file on the list
              java.util.List files = (java.util.List)
                  t.getTransferData(DataFlavor.javaFileListFlavor);
              java.io.File file = (java.io.File)files.get(0);
              field.setText(file.getName());
         // If anything goes wrong with the transfer, just beep and do nothing.
         catch (Exception e) { this.getToolkit().beep(); }
         * This method implements the ClipboardOwner interface.  It is called when
         * something else is placed on the clipboard.
        public void lostOwnership(Clipboard c, Transferable t) {
         // Un-highlight the text field, since we don't "own" the clipboard
         // anymore, and the text is no longer available to be pasted.
         field.select(0,0);
    }

    Oh, no wonder I have such low "reading for comprehension" scores - that was a "package" statement, not an "import".
    Thing is, your class would compile with this package statement there - but, the interpreter wouldn't be able to find it, 'cause the compiled class would be in a package called com.davidflanagan.examples.datatransfer accoding to the class file, but your interpreter would be looking for the class in the default package (if that makes sense). If executed on the command line you would likely see something like:
    Exception in thread "main" java.lang.NoClassDefFoundError: SimpleCutAndPaste (wrong name: com/davidflanagan/examples/datatransfer/SimpleCutAndPaste)
    [pre]
    Lee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for