...is not abstract and does not override abstract method compare

Why am I getting the above compile error when I am very clearly overriding abstract method compare (ditto abstract method compareTo)? Here is my code -- which was presented 1.5 code and I'm trying to retrofit to 1.4 -- followed by the complete compile time error. Thanks in advance for your help (even though I'm sure this is an easy question for you experts):
import java.util.*;
   This program sorts a set of item by comparing
   their descriptions.
public class TreeSetTest
   public static void main(String[] args)
      SortedSet parts = new TreeSet();
      parts.add(new Item("Toaster", 1234));
      parts.add(new Item("Widget", 4562));
      parts.add(new Item("Modem", 9912));
      System.out.println(parts);
      SortedSet sortByDescription = new TreeSet(new
         Comparator()
            public int compare(Item a, Item b)   // LINE CAUSING THE ERROR
               String descrA = a.getDescription();
               String descrB = b.getDescription();
               return descrA.compareTo(descrB);
      sortByDescription.addAll(parts);
      System.out.println(sortByDescription);
   An item with a description and a part number.
class Item implements Comparable     
      Constructs an item.
      @param aDescription the item's description
      @param aPartNumber the item's part number
   public Item(String aDescription, int aPartNumber)
      description = aDescription;
      partNumber = aPartNumber;
      Gets the description of this item.
      @return the description
   public String getDescription()
      return description;
   public String toString()
      return "[descripion=" + description
         + ", partNumber=" + partNumber + "]";
   public boolean equals(Object otherObject)
      if (this == otherObject) return true;
      if (otherObject == null) return false;
      if (getClass() != otherObject.getClass()) return false;
      Item other = (Item) otherObject;
      return description.equals(other.description)
         && partNumber == other.partNumber;
   public int hashCode()
      return 13 * description.hashCode() + 17 * partNumber;
   public int compareTo(Item other)   // OTHER LINE CAUSING THE ERROR
      return partNumber - other.partNumber;
   private String description;
   private int partNumber;
}Compiler error:
TreeSetTest.java:25: <anonymous TreeSetTest$1> is not abstract and does not over
ride abstract method compare(java.lang.Object,java.lang.Object) in java.util.Com
parator
            public int compare(Item a, Item b)
                       ^
TreeSetTest.java:41: Item is not abstract and does not override abstract method
compareTo(java.lang.Object) in java.lang.Comparable
class Item implements Comparable
^
2 errors

According to the book I'm reading, if you merely take
out the generic from the code, it should compile and
run in v1.4 (assuming, of course, that the class
exists in 1.4). I don't know what book you are reading but that's certainly incorrect or incomplete at least. I've manually retrofitted code to 1.4, and you'll be inserting casts as well as replacing type references with Object (or the erased type, to be more precise).
These interfaces do exist in 1.4, and
without the generics.Exactly. Which means compareTo takes an Object, and you should change your overriding method accordingly.
But this raises a new question: how does my 1.4
compiler know anything about generics? It doesn't and it can't. As the compiler is telling you, those interfaces expect Object. Think about it, you want to implement one interface which declares a method argument type of Object, in several classes, each with a different type. Obviously all of those are not valid overrides.

Similar Messages

  • Why it is not overriding

    Hi,
    I m puzzled by the output of :
    public class MyClass2 {
    private void f() {
    System.out.println("private f()");
    public static void main(String[] args) {
    MyClass2 po = new Derived();
    po.f();
    class Derived extends MyClass2 {
    public void f() {
    System.out.println("public f()");
    output: private f(); why it is happening...... when it is said that at runtime base class's ref chk the object that it is holding & executes its method ...ie; runtime polymorphism ...but in above case ...can any body tell why it is not happening.......?
    Thanks in advance.....

    Read the OPs question again: The method of the base class is private and the method of the subclass is public, not the other way around!
    When you override the method, the signature must remain the same. You can change the access modifier but only to a less restricted one. That's what the OP did!
    So you can't make a public method private. Correct!
    But you could make a protected one private.Wrong! You could make a protected one public.
    @OP: private members are only visible in the class it defines - not in subclasses. So the subclass would not know that there is a method with the same signature and that it overrides this method!
    So what happens? If you redeclare a method in a subclass a method, which was private in the superclass, it hides the method of the superclass. Polymorphism does not apply when calling private methods!
    public static void main(String[] args) {
      MyClass2 po1 = new MyClass2();
      po1.f(); //-> calls private method of MyClass2; can only be called from within MyClass2; no polymorphism!
      MyClass2 po2 = new Derived();
      po2.f(); //-> calls private method of MyClass2 because po2 is declared as MyClass2; can only be called from within MyClass2; no polymorphism!
      Derived po3 = new Derived();
      po.f(); //-> calls public method of Derived, which *hides* the method of MyClass2
      MyClass2 po4 = new Derived();
      ((Derived) po).f(); // -> po4 is declared as MyClass2 but we explicitly cast it to Derived, so the method of Derived gets called.
    }Look up hiding for more information!
    -Puce

  • Is not abstract and does not override abstract method actionPerformed

    I dont how to corr. Please help!! and thank you very much!!
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class test extends JFrame implements ActionListener, ItemListener
              private CenterPanel centerPanel;
              private QuestionPanel questionPanel;
              private ButtonPanel buttonPanel;
              private ResponsePanel responsePanel;
              private JButton b1,b2,b3,b4,b5;               //Create five references to Jbutton instances
         private JTextField t1,t2,t3,t4,t5;          //Create five references to JTextField instances
              private JLabel label1;                    //Create one references to JLabel instances
              private JRadioButton q1,q2,q3;               //Create three references to JRadioButton instances
              private ButtonGroup radioGroup;               //Create one references to Button Group instances
              private int que1[] = new int[5];           //Create int[4] Array
              private int que2[] = new int[5];
              private int que3[] = new int[5];
              private String temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10,
                        temp11, temp12, temp13, temp14, temp15;
    public test (String header)
              super(header);
              Container container = getContentPane();
              label1 = new JLabel ("PLease click on your response to ");     
              q1 = new JRadioButton("I understand most of the content of this subject",true);
              add(q1);
              q2 = new JRadioButton("I see the relevance of the subject to my degree",false);
              add(q2);
              q3 = new JRadioButton("The workload in this subject is appropriate",false);
              add(q3);
              radioGroup = new ButtonGroup();               //JRadioButton belong to ButtonGroup
              radioGroup.add(q1);
              radioGroup.add(q2);
              radioGroup.add(q3);
              JPanel buttonPanel = new JPanel();
              JPanel responsePanel = new JPanel();
              JPanel questionPanel = new JPanel();
              JPanel centerPanel = new JPanel();
              b1 = new JButton ("Strongly DISAGREE");          //Instantiate JButton with text
              b1.addActionListener (this);               //Register JButtons to receive events
              b2 = new JButton ("DISAGREE");
              b2.addActionListener (this);
              b3 = new JButton ("Neither AGREE or DISAGREE");
              b3.addActionListener (this);
              b4 = new JButton ("AGREE");
              b4.addActionListener (this);
              b5 = new JButton ("Strongly AGREE");
              b5.addActionListener (this);
              buttonPanel.setLayout(new GridLayout(5,1));
              buttonPanel.add(b1);
              buttonPanel.add(b2);
              buttonPanel.add(b3);
              buttonPanel.add(b4);
              buttonPanel.add(b5);
              t1 = new JTextField ("0",3);               //JTextField contains empty string
              t2 = new JTextField ("0",3);
              t3 = new JTextField ("0",3);
              t4 = new JTextField ("0",3);
              t5 = new JTextField ("0",3);
              t1.setEditable( false );
              t2.setEditable( false );
              t3.setEditable( false );
              t4.setEditable( false );
              t5.setEditable( false );
              responsePanel.setLayout(new GridLayout(5,1));
              responsePanel.add(t1);
              responsePanel.add(t2);
              responsePanel.add(t3);
              responsePanel.add(t4);
              responsePanel.add(t5);
              questionPanel.setLayout(new GridLayout(4,1));
              questionPanel.add(label1);
              questionPanel.add(q1);
              questionPanel.add(q2);
              questionPanel.add(q3);
              centerPanel.add(buttonPanel,BorderLayout.CENTER);
              centerPanel.add(responsePanel,BorderLayout.EAST);
              container.add(centerPanel,BorderLayout.WEST);
              container.add(questionPanel,BorderLayout.NORTH);
              q1.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que1[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp1 = String.valueOf(que1[0]);
              t1.setText(temp1);
              else if (e.getSource() == b2)     {
                   que1[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp2 = String.valueOf(que1[1]);
              t2.setText(temp2);
              else if (e.getSource() == b3)     {
                   que1[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp3 = String.valueOf(que1[2]);
              t3.setText(temp3);
              else if (e.getSource() == b4)     {
                   que1[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp4 = String.valueOf(que1[3]);
              t4.setText(temp4);
              else if (e.getSource() == b5)     {
                   que1[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp5 = String.valueOf(que1[4]);
              t5.setText(temp5);
    } //end action performed
              q2.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que2[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp6 = String.valueOf(que2[0]);
              t1.setText(temp1);
              else if (e.getSource() == b2)     {
                   que2[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp7 = String.valueOf(que2[1]);
              t2.setText(temp7);
              else if (e.getSource() == b3)     {
                   que2[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp8 = String.valueOf(que2[2]);
              t3.setText(temp8);
              else if (e.getSource() == b4)     {
                   que2[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp9 = String.valueOf(que2[3]);
              t4.setText(temp9);
              else if (e.getSource() == b5)     {
                   que2[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp10 = String.valueOf(que2[4]);
              t5.setText(temp10);
    } //end action performed
              q3.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que3[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp11 = String.valueOf(que3[0]);
              t1.setText(temp11);
              else if (e.getSource() == b2)     {
                   que3[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp12 = String.valueOf(que3[1]);
              t2.setText(temp12);
              else if (e.getSource() == b3)     {
                   que3[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp13 = String.valueOf(que3[2]);
              t3.setText(temp13);
              else if (e.getSource() == b4)     {
                   que3[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp14 = String.valueOf(que3[3]);
              t4.setText(temp14);
              else if (e.getSource() == b5)     {
                   que3[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp15 = String.valueOf(que3[4]);
              t5.setText(temp15);
    } //end action performed
    }//end constructor test
    public void itemStateChanged(ItemEvent item) {
    //int state = item.getStateChange();
    //if (q1 == item.SELECTED)
              public class ButtonPanel extends JPanel
                   public ButtonPanel()
              public class CenterPanel extends JPanel
                   public CenterPanel()
              public class QuestionPanel extends JPanel
                   public QuestionPanel()
              public class ResponsePanel extends JPanel
                   public ResponsePanel()
    public static void main(String [] args)
         test surveyFrame = new test("Student Survey") ;
         surveyFrame.setSize( 500,300 );
         surveyFrame.setVisible(true);
         surveyFrame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
         }//end main
    }//end class test

    is not abstract and does not override abstract method actionPerformed
    Oh, I see that the title of your post is an error message? Ok. Well, the test class is declared as implementing an ActionListener. That means the test class must have an actionPerformed() method. Your test class apparently does not.
    It does not appear that the test class needs to implement ActionListener. You are using annonymous classes as listeners.

  • Is not abstract and does not override abstract method tablechanged

    I will remove all the gui code to make it shorter, but my problem lies with my InteractiveTableModelListener.
    public class Meet extends JPanel{
      private static void createAndShowGUI() {
            JFrame frame = new JFrame("MEET_dataTable");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(new Meet(), BorderLayout.CENTER);
            frame.pack();
            frame.setVisible(true);
    public class InteractiveTableModelListener implements TableModelListener {
         public void TableChanged(TableModelEvent evt) {
      if (evt.getType() == TableModelEvent.UPDATE) {
          int column = evt.getColumn();
          int row = evt.getFirstRow();
          dataTable.setColumnSelectionInterval(column + 1, column + 1);
          dataTable.setRowSelectionInterval(row, row);
    class InteractiveRenderer extends DefaultTableCellRenderer {
      protected int interactiveColumn;
      public InteractiveRenderer(int interactiveColumn) {
          this.interactiveColumn = interactiveColumn;
    public Component getTableCellRendererComponent(JTable dataTable,
         Object value, boolean isSelected, boolean hasFocus, int row,
         int column)
      Component c = super.getTableCellRendererComponent(dataTable, value, isSelected, hasFocus, row, column);
       if (column == interactiveColumn && hasFocus) {
         if ((Meet.this.tableModel.getRowCount() - 1) == row &&
            !Meet.this.tableModel.hasEmptyRow())
             Meet.this.tableModel.addEmptyRow();
        highlightLastRow(row);
      return c;
    public void highlightLastRow(int row) {
         int lastrow = tableModel.getRowCount();
      if (row == lastrow - 1) {
          dataTable.setRowSelectionInterval(lastrow - 1, lastrow - 1);
      else {
          dataTable.setRowSelectionInterval(row + 1, row + 1);
         dataTable.setColumnSelectionInterval(0, 0);
    public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                UIManager.put("swing.boldMetal", Boolean.FALSE);
                createAndShowGUI();
    }As i say, i have removed all the gui code to make it shorter, but in this code i create the table and add all the model to it. I am being returned with the error
    Meet.InteractiveTableModelListener is not abstract and does not override abstract method tableChanged(javax.swing.event.TableModelEvent)in javax.swing.event.TableModelListener
    what would be causing this error?
    Cheers

    Sorry, just figured out my silly error, the method is tableChanged not TableChanged.
    cheers
    TOPIC CLOSED
    Edited by: nick2price on Sep 11, 2008 7:08 AM

  • Is not abstract and does not override abstract method ERROR

    Hello. I'm new at all this, and am attempting to recreate a sample code out of my book (Teach Yourself XML in 24 Hours), and I keep getting an error. I appriciate any help.
    This is the Error that I get:
    DocumentPrinter is not abstract and does not override abstract method skippedEntity(java.lang.String) in org.xml.sax.ContentHandler
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
            ^This is the sourcecode:
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
    // A Constant containing the name of the SAX parser to use.
    private static final String PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
    public static void main(String[] args)
       // Check to see whether the user supplied any command line arguments.  If not, print an error and exit.
       if (args.length == 0)
         System.out.println("No XML document path specified.");
         System.exit(1);
       // Create a new instance of the DocumentPrinter class.
       DocumentPrinter dp = new DocumentPrinter();
       try
         // Create a new instance of the XML Parser.
         XMLReader parser = (XMLReader)Class.forName(PARSER_NAME).newInstance();
         // Set the parser's content handler
        // parser.setContentHandler(dp);
         // Set the parsers error handler
         parser.setErrorHandler(dp);
         // Parse the file named in the argument
         parser.parse(args[0]);
       catch (Exception ex)
         System.out.println(ex.getMessage());
         ex.printStackTrace();
    public void characters(char[] ch, int start, int length)
       String chars ="";
       for (int i = start; i < start + length; i++)
         chars = chars + ch;
    System.out.println("Recieved characters: " + chars);
    public void startDocument()
    System.out.println("Start Document.");
    public void endDocument()
    System.out.println("End of Document.");
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    System.out.println("Start element: " + localName);
    for (int i = 0; i < atts.getLength(); i++)
    System.out.println(" Attribute: " + atts.getLocalName(i));
    System.out.println(" Value: " + atts.getValue(i));
    public void endElement(String namespaceURI, String localName, String qName)
    System.out.println("End of element: " + localName);
    public void startPrefixMapping(String prefix, String uri)
    System.out.println("Prefix mapping: " + prefix);
    System.out.println("URI: " + uri);
    public void endPrefixMapping(String prefix)
    System.out.println("End of prefix mapping: " + prefix);
    public void ignorableWhitespace(char[] ch, int start, int length)
    System.out.println("Recieved whitespace.");
    public void processingInstruction(String target, String data)
    System.out.println("Recieved processing instruction:");
    System.out.println("Target: " + target);
    System.out.println("Data: " + data);
    public void setDocumentLocation(Locator locator)
    // Nada
    public void error(SAXParseException exception)
    System.out.println("Parsing error on line " + exception.getLineNumber());
    public void fatalError(SAXParseException exception)
    System.out.println("Fatal parsing error on line " + exception.getLineNumber());
    public void warning(SAXParseException exception)
    System.out.println("Warning on line " + exception.getLineNumber());

    Check to make sure that the arguments are consistent with your ContentHandler class. Probably the wrong type.
    I think you forgot to include the skippedEntity method, it seems to be missing. Even if an implemented class has a method that you are not using, you still have to include the method in your code even if it doesn't do anything.
    Message was edited by:
    ChargersTule1

  • Product is not abstract and does not override abstract method

    Received the following errors.
    Product.java:3: Product is not abstract and does not override abstract method ge
    tDisplayText() in Displayable
    public class Product implements Displayable
    ^
    Product.java:16: getDisplayText() in Product cannot implement getDisplayText() i
    n Displayable; attempting to use incompatible return type
    found : void
    required: java.lang.String
    public void getDisplayText()
    ^
    2 errors
    Code reads as follows
    import java.text.NumberFormat;
    public class Product implements Displayable
         private String code;
         private String description;
         private double price;
         public Product()
              this.code = "";
              this.description = "";
              this.price = 0;
    public void getDisplayText()
    String message =
    "Code: " + code + "\n" +
    "Description: " + description + "\n" +
    "Price: " + this.getFormattedPrice() + "\n";
         public Product(String code, String description, double price)
              this.code = code;
              this.description = description;
              this.price = price;
         public void setCode(String code)
              this.code = code;
         public String getCode(){
              return code;
         public void setDescription(String description)
              this.description = description;
         public String getDescription()
              return description;
         public void setPrice(double price)
              this.price = price;
         public double getPrice()
              return price;
         public String getFormattedPrice()
              NumberFormat currency = NumberFormat.getCurrencyInstance();
              return currency.format(price);
    Please help!

    Received the following errors.
    Product.java:3: Product is not abstract and does not
    override abstract method ge
    tDisplayText() in Displayable
    public class Product implements Displayable
    ^
    Product.java:16: getDisplayText() in Product cannot
    implement getDisplayText() i
    n Displayable; attempting to use incompatible return
    type
    found : void
    required: java.lang.String
    public void getDisplayText()
    ^
    2 errors
    Code reads as follows
    Please use the code tags when posting code. There is a code button right above the text box where you enter your post. Click on it and put the code between the code tags.
    These error messages are quite clear in telling what is wrong. You have an Interface called Displayable that specifies a method something like thispublic String getDisplayText() {But in your Product source code, you created thismethodpublic void getDisplayText() {The compiler is complaining because the methods are not the same.
    You also need to return a String in the method probalby like thisreturn message;

  • Why java does not force to declare atleast one abstract method

    hi,
    i can define an abstract class without declaring any abstract method in that class. But why wud i do this ? i mean when i have decided that a particular class should be inherited by other subclass and subclass should porvide implementation then there should be atleast one method in the abstract super class which requires implementation.
    All i want to know is why java does not force to declare atleast one abstract method in abstract class.
    there may be some situations where this restriction can create problem if it is like that then can anybody give some example.
    manish

    hi,
    i didn't get u.
    u r trying to say that i have an abstract class with
    only static methods then my questions is why wud
    declare such a class as 'abstract' class? because a
    static method can't be abstract also. Even then if
    somebody want to define such a class with only static
    methods then compiler should force him to declare
    atleast one abstract method which can be implemented
    by subclass, because as i said before if sumbody
    decide to define a class abstract then he wants that
    it should be inhereted but as u r saying a class with
    only static methods then it should not be an abstract
    class it can be a simple class.there's no functional reason, really... actually, factory-like classes are often defined the way Ceci described
    "abstract" only ensures that nobody can ever get an instance of that class (as a matter of fact, what would be the point of getting an instance, if no instance method exists ?)

  • Abstract Methods and Override Don't work For SubPackages

    I have an abstract class called "A" in a package called test.
    package test;
    public abstract class  A
        int x;
        public A (int x)
            this.x = x;
        abstract void testMethod();
    }And I have a sub class of "A" called "SubA" in a sub package of "test" called "test.subPkg":
    package test.subPkg;
    import test.A;
    public class SubA extends A {
        public SubA(int x)
            super(x);
        @Override
        void testMethod()
            throw new UnsupportedOperationException("Not supported yet.");
    }Now when I try to compile, it gives me the error:
    /home/eric/NetBeansProjects/drum-tabber4/trunk/src/test/subPkg/SubA.java:6: test.subPkg.SubA is not abstract and does not override abstract method testMethod() in test.A
    public class SubA extends A {
    /home/eric/NetBeansProjects/drum-tabber4/trunk/src/test/subPkg/SubA.java:14: method does not override or implement a method from a supertype
    If I put SubA in the above package "test" instead of "test.subPkg", it compiles fine. But I don't want to do that because I have a lot of sub classes that are organized differently in separate sub packages.
    If I make A an interface, it compiles fine. But I don't want to do that either because I want A to implement the constructor.
    Anyone have any idea of how to fix this issue?

    Now when I try to compile, it gives me the error:
    /home/eric/NetBeansProjects/drum-tabber4/trunk/src/test/subPkg/SubA.java:6: test.subPkg.SubA is not abstract and does not override abstract method testMethod() in test.A
    public class SubA extends A {
    /home/eric/NetBeansProjects/drum-tabber4/trunk/src/test/subPkg/SubA.java:14: method does not override or implement a method from a supertype
    If I put SubA in the above package "test" instead of "test.subPkg", it compiles fine. But I don't want to do that because I have a lot of sub classes that are organized differently in separate sub packages.Thats because method testMethod() in class A has a default access modifier. Meaning, that testMethod() will only be visible within the same package and not outside of package test. Expand the access modifier of testMethod() in class A, either make it protected or public, like this...
    protected abstract void testMethod();
    OR
    public abstract void testMethod();

  • IconItemRenderer does not override getCurrentRendererState()

    I have an ItemRenderer that I've been using for a web app's List, now I need to convert that app into a Mobile App.  I am trying to use the optimized IconItemRenderer to display that same item.  My Previous Code has:
    override public function set data(value:Object):void {
         super.data = value;
         value_ti.text = value.ProdValue;
         invalidateProperties();
    override protected function commitProperties():void  {
         setCurrentState(getCurrentRendererState(), (mx_internal::playTransitions as Boolean));
         super.commitProperties();
    override protected function getCurrentRendererState():String {
         var state:String = super.getCurrentRendererState();
         if (state == 'normal') {
              if (data.date_purchased != null) {
              state = 'sold';
              } else {
              state = 'normal';
              } else if (state == 'sold') {
              this.mouseEnabled = false;
              this.mouseChildren = false;
         return state;
    With the code above, I figured I would simply change the ItemRenderer to an IconItemRenderer, and would solve the problem... though... Flash Builder gave me the Error: 1020: Method marked override must override another method. Refering to the method: getCurrentRendererState();
    I figure getCurrentRendererState() does not exist in the IconItemRenderer...
    Is it possible to achieve the code above through the IconItemRenderer?

    Short answer:  You'll have to reimplement your itemRenderer.  It is unclear from your code snippet how you have implemented states.
    Longer story:
    The IconItemRenderer extends LabelItemRenderer which extends UIComponent. 
    Mobile ItemRenderers are implemented differently than MXML ItemRenderers.  They are more like Mobile Skins than Spark components, or Spark ItemRenderers.  States are really just a fantasy; and you implement states by making changes to children, colors, or other visual elements manually in updateDisplayList(); or if you follow the MobileSkin conventions, in layoutContents() and drawBackground().
    The method you're looking for is implemented in the itemRenderer class, which Mobile ItemRenderers do not implement. These are some blog posts I wrote on building Mobile itemRenderers:
    https://www.flextras.com/blog/index.cfm/2011/6/17/Mobile-itemRenderers--6172011---Episode- 103--Flextras-Friday-Lunch
    https://www.flextras.com/blog/index.cfm/2011/6/23/Understanding-Mobile-itemRenderers
    https://www.flextras.com/blog/index.cfm/2011/6/24/Building-a-Mobile-ItemRenderer-in-Flex
    I have one coming soon on implementing states in Mobile Skins; which will apply equally to itemRenderers.  I'll go over most of the content in tomorrow's Flextras Friday Lunch episode

  • Customized Cache Config and Coherence Override files not Overrided.

    Hi,
    I am doing an example on coherence and was wondering if anyone can help with a couple of questions.
    1. I am trying to override the coherence-cache-config.xml and tangosol-coherence-override.xml with my custom xmls. But when I start cache server from cache-server.cmd executable provided in bin folder of Coherence, it is not able to pick up the overrided files. How can I override both these files.
    2. In most of the examples a new executable file is made for cache server start and the custom coherence-cache-config.xml is specified in this. The examples runs perfectly fine but I'm not able to see the same cache elements available when I run cache-server and cache-client present in the bin folder of Coherence. How can I integrate both of them.
    3. When we use Coherence as a web service from server, are we suppose to use run cache-server.cmd for starting the cache server or make some custom file executable file made for cache server start.
    I know some of the questions may sound silly to you but I'm not still able to figure the answer to these question.
    Any help will be appreciated.
    Cheers,
    Varun

    Hi Varun,
    Yes you can use the property -Dtangosol.coherence.cacheconfig =<file_name> for specifying the override file. No creating a jar is not a bottleneck and you can use either jar or system property in Production Environment. It completely depends on how your environment is setup and is for the flexibility pruposes? Use whichever is handy ...
    Ideally, you WS application should run in a seperate JVM than your Coherence Nodes. In this scenario, your WS application is set as storage-disabled and your Coherence nodes will be set as storage-enabled and both WS and Coherence Nodes will be part of the Coherence cluster. There will be no syncing between WS application and Coherence Nodes if you are using distributed cache; all the data requests from the WS application will be served by the Coherence Nodes. But, if you are using Near Cache then the data syncing will depend on the invalidation strategy used by you in your cache configuration. Read more about near-cache scheme here: http://wiki.tangosol.com/display/COH35UG/near-scheme.
    In WLS 10.3.4, there is a integration of Coherence and you can create Coherence Cluster from the Admin Console and define various Coherence cluster nodes and the documentation is here (http://download.oracle.com/docs/cd/E17904_01/web.1111/e16517/coh_wls.htm). But if you are using any other version of Weblogic or any other container then you cannot start from Weblogic but you need to start them seperately. Also, you need to make sure that the Coherence Nodes with storage-enabled are started before the storage-disabled nodes.
    Hope this helps!
    Cheers,
    NJ

  • Java.lang.AssertionError: Can not find generic method public abstract

    I just downloaded the JDev 11g and trying to test the JEE web app. Below is my install:
    JDeveloper 11g
    JEE Web Project
    EJB 3.0
    Steps taken:
    1. Created an entity bean from a table.
    2. Created a session facade
    3. Create sample Java client to use the facade (Right-click on the session facade, and choose New sample Java Client from the context menu)
    4. Run the session facade
    5. Run the Java client
    I got the following error.
    java.lang.AssertionError: Can not find generic method public abstract java.util.List<com.oracle.orm.model.ejb.persistence.Hosttags> queryHosttagsFindAll() in EJB Object
    I checked the methods in the beans and interfaces, they are all there. Any idea?
    Thanks.

    I have a customer that has this problem.
    We wrote me that:
    we got a java.lang.NoSuchMethodException while the method exist even in the generated (by WLS) stub.
    when we change the interface by putting a "list" instead of list <> then it works.
    hope it can help, but should be great know why.
    Regards
    Marco
    글 수정: user10649412

  • Imovie is limited to its import formats and does not allow for storing video in any rawformat.  Which means all videos will contain lossy compression applied to the video-.with no way to edit full format video.  Is this statement true?

    Imovie is limited to its import formats and does not allow for storing video in any rawformat.  Which means all videos will contain lossy compression applied to the video….with no way to edit full format video.  Is this statement true? Does iMovie support HD 1080p @ 60 fps?

    Iggy826 wrote:
    …   Is this statement true?
    yes and no!
    using the intended Import from Camera routines, iM converts automatically in its very own AppleIntermediateCodec. so, answer is yes.
    but …
    a) Apple claims , aic is non-lossy intermediate codec. working with proRes in FCPX taught me, there are even less non-lossy-ness codecs
    b) iM offers an Archive feature, which is basically a simple Finder/copy operation which 'clones' your SDcards content into some folder on your harddrive; e.g. you can later use these untouched  'raws' in another editor such as FCPX. so, answer is no.
    c) when you 'override' the import routines by manually re-wrapping mts into a mov container, iM handles the 'native' h264s ... so, answer is no.
    d) adding any effect, transition etc. reduces any interlaced source to 540p. (if you're working with 720p source, res is kept) … so, answer is yes. or, in 720p case, no.
    < Johnny Depp's voice >… savvy?
    Does iMovie support HD 1080p @ 60 fps?
    via Import from Camera? No.
    via re-wrapped mts>>mov? I was told yes, some say no.
    one thing to be kept in mind when talking about these 'issues':
    iM, this 12€, is meant as a CONSUMER toy tool.
    it supports AVCHD vers1 (=no 1080/60p, no >24Mbps, no 3D).
    fingers crossed, we'll see soon some iM/QT/FCPX update for support of AVCHD v2 ........
    the main consumer devices are within the specs, iM supports.
    using professional equipments makes usage of professional software (FCPX, AP) optional.
    sorry for lengthy answer.

  • My ipod touch is in dfu mode and does not want to turn on.

    my ipod touch is in dfu mode and does not want to turn on.

    What happens when you connect the iPod to your computer and restore viia iTunes?

  • IPhone 3GS no longer recognized in iTunes and does not charge via wall

    I upgraded my iMac to iTunes 9.2 when it came out.
    My wife then upgraded her iPhone 3GS to iOS4.
    Since then it is not recognized in iTunes and does not charge via the wall adapter.
    I realize this topic crosses over with several ongoing discussions, but there are no 3rd party peripherals involved here.
    The only major changes to our set up have been the itunes and iOS upgrades.
    The battery is running down, any ideas to fix this, or other similar experiences welcome.

    Went to the Apple store and they replaced the cable.

  • I shattered my phone and does not turn on I have apple care. How much would it be to replace it?

    I have an iphone 4s and I dropped it down some steps and its completely shattered and does not turn on. I have apple care. Does apple care last for 2 years? I replaced it once before with no charge. Would I be charged this time? Please help.

    You have AppleCare or AppleCare+. If you have regular AppleCare, accidental damage is not covered. It will cost you $199 for a replacement. If you have AppleCare+, and you're within 2 years of buying the original phone, then you can have it replace for (I believe) $49. That was the quoted replacement price when AppleCare+ first started being sold.

Maybe you are looking for

  • How can I open .pdf files in Safari 5.1 ?

    The Problem: After loading OSX 10.7.1, whenever I try to open a .pdf file from a website using Safari 5.1, I get a blank gray/black screen with the Quicktime  Q symbol in the middle. Notes: I downloaded and set my preference to use Adobe Reader versi

  • ITunes cannot open HELP NEEDED!

    Everytime I try and open it, it will say that it has encountered a problem and needs to close. I have used Windows Install Clean-up b/c it gets an error when uninstalling normally, deleted the two quicktime files in system32, manually deleted both th

  • Invoices report that displays also the VAT number

    Hi I am looking for invoices report that displays also the customer/vendor name and its VAT registration number. The customer invoices are SD invoices (can be displayed using the FI) and the supplier invoices are MM or FI invoices. It is relevant for

  • How to debug flash remoting?

    Hi I am using -  flashremoting.jar 1.0.52502 on tomcat. I have a 3 year old application that is running on 1 server, it works fine there, the flash client can connect to the java tomcat server and call methods and all is well. We are trying to stand

  • Help for using BAPI_DOCUMENT at UNIX directory

    Hello together, please, i need urgent help. A WORD-document (saved on a PC) was linked to a material with FB "BAPI_DOCUMENT_CREATE2". Everything is ok. Now, during a background process this document will be change or enlarged at severals workingpoint