Overriding createToolTip?

I am trying to override createToolTip in order to get a multi-line tooltip. It works fine for JButton but it does not work for my DefaultTableCellRenderer. Does anybody know why?
public class MyDefaultCellRenderer extends DefaultTableCellRenderer {
  public MyDefaultCellRenderer() {
    super();
  public JToolTip createToolTip() {
    return new MultiLineToolTip();
}Thanks

Matt,
Not sure if I've simulated what you're doing, but I've managed to get round your problem by getting the JTable to override createToolTip() rather than the renderer - the renderer simply sets its own tool tip text. Here's some test code you can try - it's not a multi-line tooltip but a bespoke tooltip nevertheless which changes the default colours:
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame
public Test()
     super( "Tooltip Test" );
     setSize( 500, 500 );
     MyModel model = new MyModel();
     JTable jt = new JTable( model ) { public JToolTip createToolTip() { return new MyToolTip(); } };
     jt.setDefaultRenderer( String.class, new MyRenderer() );
     JScrollPane jsp = new JScrollPane( jt );
     JPanel p = new JPanel();
     p.add( jsp, BorderLayout.CENTER );
     JButton b = new JButton( "Press me" ) { public JToolTip createToolTip() { return new MyToolTip(); } };
     b.setToolTipText( "I'm a button" );
     p.add( b );
     getContentPane().add( p );
public static void main(String args[])
     Test t = new Test();
     t.setVisible(true);
import javax.swing.*;
public class MyToolTip extends JToolTip
public MyToolTip()
     setForeground(java.awt.Color.red);
     setBackground(java.awt.Color.yellow);
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
public class MyRenderer extends JLabel implements TableCellRenderer
public MyRenderer()
     super();
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,      boolean hasFocus, int row,int column)
     if (value != null) { setText( ( String ) value ); }
     setToolTipText( "I'm a renderer" );
     return this;
import javax.swing.table.*;
public class MyModel extends AbstractTableModel
  Class columnClasses[] = {String.class, String.class};
  Object  data[][] = {
     {"Who", "needs"},
     {"tooltips", "anyway"}
  public Class getColumnClass(int c)
      return columnClasses[c];
  public int getColumnCount() { return data[0].length; }   
  public int getRowCount() { return data.length; }   
  public Object getValueAt(int r, int c) { return data[r][c]; }   
public void setValueAt(Object value, int r, int c) { data[r][c] = value; }   
}

Similar Messages

  • Tooltips with multiple lines possible?

    Hello,
    how is it possible to modify the tooltip so that �t reacts to carriage returns - and shows multiple lines?
    Any help appreciated.
    Thanx.
    alex

    Hi,
    I know two possible ways:
    1) The HTML-way like in
    http://javaalmanac.com/egs/javax.swing/tooltip_MultiLineTt.html
    2) Subclass BasicToolTipUI and adjust the its paint() method. Then create a new JToolTip and set your new UI. Next override createToolTip() on those JComponents which should get the new tooltip.
    HTH,
    Michael

  • J Tool Tips - Strange and Awkward Bug

    Hello Everyone,
    I am having a very strange J Tool Tip bug. Okay first of all, the tool tip that I have created works when it is inside of a single panel for a single label. Basically, what I have is a number of J Labels - each having a unique tool tip. Here is the most basic of my code (notice that I have customized my own Tool Tip to have a yellow background and black foreground):
    currentLabel = new JLabel("LABEL TEST")
                // Extends the JLabel and overrides createToolTip() to return a custom tool tip:
                @Override
                public JToolTip createToolTip()
                    JToolTip toolTip = super.createToolTip();
                    toolTip.setComponent(this);
                    toolTip.setBackground(Color.YELLOW);
                    toolTip.setForeground(Color.BLACK);
                    return toolTip;
            currentLabel.setToolTipText("Testing Tool Tip Message");Okay, so here's the deal. Here's the tricky part. When I have this label nested inside of a Grid Bag Layout Panel, it works perfectly fine. It shows up when the user's mouse hovers over the label.
    Here's my problem. The project that I am working on is actually nested in many complicated panels. This project has about 100 java files, so I am just going to cut it short and let you know which kind of panels it is nested in.
    Starting from the lowest panel:
    1. J Panel (Grid Bag Layout)
    2. J Panel (Box Layout)
    3. J Panel (Border Layout)
    4. J Split Pane (Right Side)
    5. J Panel (Border Layout) (Largest Panel)
    One of the things I noticed is that now when I hover over the labels, a very small microscopic blue dot appears right to the left of the mouse cursor. I seriously think this is the Tool Tip, but for some reason it isn't showing any text. The strange thing is that the tool tip works when panels 2, 3, 4, and 5 are non-existent. If you guys have any ideas or suggestions, please let me know! I'd really appreciate it!
    Thanks,
    Brian

    What I might do is : see if listening for mouseEntered and mouseExited events work on the labels when in their complex arrangement. And make a little tooltip class based on JWindow (perhaps with a JLabel on its contentpane so you can display HTML). I found this approach more reliable. Though one would expect this is what is already implemented, the inbilt behaviour may overcomplicate things resulting in some no-shows. I seem to remember having this problem with tootips on table cell renderers.
    Edited by: kina_tji on Jul 23, 2008 6:33 PM

  • How To Make mozilla.cfg, override.ini, all-companyname.js, Files To Work Once And For All For All Users

    I'm currently trying to apply a fix to the firefox browser (version 23.0.1) on over 250 computers. Setting default webpages, disabling annoying prompts like the default browser and importing bookmarks, and erasing the history on shutdown, or startup. This is very easily done modifying the pref.js file, but I will not edit that file, it's out of the question. Another FF update will erase or overwrite all of my modifications.
    I run a computer lab in the university that is locked down using a Net Support School console. You don't need to look that up. Basically all websites are restricted except the ones the ones I whitelist. The websites we use have extensive API's for JS, CSS, Java, PHP, etc... We utilize technology in order for students to use graphing calculators, video's, and taking module test from these white-listed websites, like Pearson, or Aleks. Now with that said, cookies, and stored profile history become a problem, and on some day's up to 25% of the students using the computers need their entire history deleted in order for a page to load. I think I fixed this problem permanently by whitelisting backend sites importing plugins, and API's etc, that I found from the developers console. Whatever. What I've learned from all of this is that Firefox can be very customizable utilizing the "...\Mozilla Firefox\mozilla.cfg" and the "...\Mozilla Firefox\defaults\prefs\all-companyname.js" (or custom.js) The problem, is no matter what I try I can't get these to work. The closest I got was here:
    http://www.intrntpirate.com/?p=615
    Again, even that ^^ didn't work. I followed these directions to a "T". What is wrong with the above information provided in the link? Why is firefox making harder and harder for us to optimize it for massive deployments across a corporation and a university? I'm not going to do any fancy hacks to avoid the main issue. I need mozilla.cfg, and the all-companyname.js, and the override.ini files to work, if and only if they are still relevant.
    These are what my files look like so far:
    name: all-lmc.js<br />
    location: C:\Program Files (x86)\Mozilla Firefox\defaults\pref\<br />
    pref("general.config.filename", "mozilla.cfg");<br />
    pref("browser.startup.homepage", "https://(some url)");<br />
    name: override.ini<br />
    location: C:\Program Files (x86)\Mozilla Firefox\<br />
    [XRE]<br />
    EnableProfileMigrator=false<br />
    <br />
    name: mozilla.cfg<br />
    location: C:\Program Files (x86)\Mozilla Firefox\<br />
    //<br />
    lockPref("privacy.sanitize.sanitizeOnShutdown", true);<br />
    lockPref("privacy.sanitize.promptOnSanitize", false);<br />
    lockPref("browser.shell.checkDefaultBrowser", false);<br />
    lockPref("toolkit.telemetry.enabled", false);<br />
    lockPref("toolkit.telemetry.prompted", 2);<br />
    lockPref("toolkit.telemetry.rejected", true);
    I've tried using, and not using, the automatic mozilla configurator. I've tried changing lockPref to pref. Nothing works. Not the override.ini, not the all-lmc.js, and not the mozilla.cfg. I've wasted hours reading through blogs of experts telling us to modify files that don't exist, or beating around the bush. I'm done researching. If you have the answer or want to help me figure this out just remember to keep it simple. Please. I ultimately want to package all the config files, with a how to, in a zip folder onto our shared drive. To have FF customized and ready to deploy to different departments across campus.

    Thanks very much for your help, but I'm still overlooking something. I double checked to make sure that I did not have a hidden .txt file extention. I then decided to abandon the lock on preferences idea until I get it working. I converted my mozilla.cfg file back to plain text. I made sure I do not have an extra blank line at the end of each file. The syntax looks good, as far as I can tell. I'll copy and paste what I have so far. Did I have the file locations correct posted above? Also, if you feel i can delete some lines of text in my mozilla.cfg file I'll be happy to do so.
    mozilla.cfg
    <pre><nowiki>//
    pref("privacy.sanitize.sanitizeOnShutdown", true);
    pref("privacy.sanitize.promptOnSanitize", false);
    pref("browser.rights.override", true);
    pref(“app.update.auto”, false);
    pref(“extensions.blocklist.enabled”, false);
    pref(“extensions.shownselectionUI”, true);
    pref(“browser.shell.checkDefaultBrowser”, false);
    pref(“toolkit.telemetry.enabled”, false);
    pref(“toolkit.telemetry.prompted”, 2);
    pref(“toolkit.telemetry.rejected”, true);
    pref(“app.update.auto”, false);
    pref(“browser.download.useDownloadDir”, true);
    pref(“browser.search.update”, false);
    pref(“signon.autofillForms”, false);
    pref(“signon.rememberSignons”, false);
    pref(“browser.download.manager.scanWhenDone”, true);
    pref(“browser.formfill.enable”, false);
    pref(“xpinstall.enabled”, true);</nowiki></pre>
    channel-prefs.js
    pref("app.update.channel", "release");
    override.ini
    [XRE]
    EnableProfileMigrator=false
    all-lmc.js
    pref("general.config.filename", "mozilla.cfg");
    defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=http://bbc.co.uk");
    Again, thank you very much for your time. Do I create my own browserconfig.properties, and firefox.js? Also, I forgot to mention I'm running Windows 8.

  • Overriding attributes in ABAP objects

    Hello,
    I currently want know if it is possible to override attributes in ABAP objects. i know it is possible with methods. I have extend a previous class functionality and want to change the refrence type of an attribute from the parent class, but only on the child. Is this possible in ABAP object or even in normal object oriented techniques.
    Thanks
    Brendan

    Hi,
    ususally you can achive this with other technics. You can e.g. use the class hierarchy for this:
    The attribute is of type REF_SUPERCLASS. Within the superclass it should be working when you set subclasses of REF_SUPERCLASS as attribute.
    Another way is to use interfaces as reference type for your attribute.
    Please refer to [ABAP Objects|http://help.sap.com/saphelp_nw70/helpdata/EN/ce/b518b6513611d194a50000e8353423/frameset.htm]. Especially the chapters about Inheritance and Interfaces.
    Regards Rudi

  • Screen saver overrides iTunes cover flow in Lion

    On my new iMac (OSX 10.7.1, iTunes 10.4.1), when in full screen cover flow mode, the screen saver overrides this, which is annoying as I like to leave it playing with the artwork displayed. This did not happen on my old (Leopard) Mac. I can't find any preference setting that seems to fix this. I dont really want to turn off the screen saver - I didn't have to before, why now?

    Have you tried creating a hot corner (System Preferences > Desktop & Screen Saver > Screen Saver - Hot Corners) to disable the screen saver by parking mouse pointer in the "hot corner."
    I'm assuming Lion still has this function.

  • 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

  • ...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.

  • When adding columns, why do I get overrides on style?

    Hi all,
    When I'm adding columns in a certain document I end up with the new columns having overrides on them. How can I avoid this?
    The columns I added are seen in the middle.
    As you can see the they all get a "shift down" by -22 pt.
    I use this shift down on some other place in the document, but the table columns are clean from that kind of override, and just by selecting a column and adding 4 new columns "to the right" of that column, I would expect the new ones to get the exact same properties as the one selected.
    Can anyone try to explain what might be wrong with my document or way of working?
    Adding info: It seems there's something in the styles - many properties on them... This has noting to do with cells specifically. Just adding a textbox results renders the text this way as well, with the baseline shift (only no override symbol).
    Best regards,
    Andreas

    Ah... now I get it. The default styles of the document were set to a specific paragraph style and another character style.
    Setting the defaults to [Basic Paragraph] and None respectively seems to put everything in order.
    (You set a default by clicking outside the document so that nothing is selected, and then you select the styles [Basic paragraph] and None)
    Case closed.

  • Is there a report Override for AR statement print in Report One Manager?

    I have created an AR Statement in Crystal and would like to use this report in the AR Aging-->Statement(one page per customer).  I don't see an Override for A/R Statements.  Does one exist?
    Never mind.  I found it.  Collection Report.
    Edited by: Pat Frohlich on Jun 9, 2009 4:22 PM

    Hello Bill,
    You might find the report in the following location to be helpful:
    Home>Application Builder>Application XXX>Application Reports>Shared Components>Application Database Object Dependencies
    Regards,
    Arie.

  • Override "Email a Page link" in ribbon button functionality in SharePoint 2013

    Hi,
    I want to override "Email a Page link" ribbon button functionality on the ribbon control.
      <CustomAction Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Location="CommandUI.Ribbon"                
                    Title="Custom Email this page">
        <CommandUIExtension>
          <CommandUIDefinitions>
            <CommandUIDefinition Location="Ribbon.WikiPageTab.Share.EmailPageLink">
              <Group
              Id="Ribbon.WikiPageTab.Share"
              Sequence="30"
              Command="ShareGroup"
              Description=""
              Title="$Resources:core,cui_GrpShare;"
              Image32by32Popup="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32PopupTop="-137" Image32by32PopupLeft="-103"
              Template="Ribbon.Templates.Flexible2"
              >
                <Controls Id="Ribbon.WikiPageTab.Share.Controls">
                  <Button
                    Id="Ribbon.WikiPageTab.Share.EmailPageLink"
                    Sequence="10"
                    Command="CustomEmailPageUrl"
                    Image16by16="/_layouts/15/$Resources:core,Language;/images/formatmap16x16.png?rev=23" Image16by16Top="-115" Image16by16Left="-19"
                    Image32by32="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32Top="-137" Image32by32Left="-511"
                    LabelText="$Resources:core,cui_ButEmailLink;"
                    ToolTipTitle="$Resources:core,cui_ButEmailLink;"
                    ToolTipDescription="$Resources:core,cui_STT_ButEmailLinkPage;"
                    TemplateAlias="o1"
                   />
                </Controls>
                  </Group>
            </CommandUIDefinition>
          </CommandUIDefinitions>
          <CommandUIHandlers>
            <CommandUIHandler Command="CustomEmailPageUrl" CommandAction="javascript:alert('Hello, world');" />
          </CommandUIHandlers>
        </CommandUIExtension>
      </CustomAction>
    Any help would be appreciated.
    Rajasekar A.C

    Hi,
    According to your post, my understanding is that you wanted to override the “E-mail a Link” button on the Ribbon.
    I had created a simple demo to override the “E-mail a Link” button on the Ribbon, you can have a look at it.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="Ribbon.Library.Actions.OverrideEmailLinkButton" Location="CommandUI.Ribbon" RegistrationId="101" RegistrationType="List" Title="Display the UniqueId for the list item.">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Library.Share.EmailLibraryLink">
    <Button Id="Ribbon.Library.Share.EmailLibraryLink.ReplacementButton" Command="ReplacementButtonCommand" Image16by16="http://s10.postimage.org/lhar0oijp/U16.png" Image32by32="http://s17.postimage.org/trf3y2ui3/U32.png" LabelText="Replaced Button" TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="ReplacementButtonCommand" CommandAction="javascript:alert('This button has been replaced.');" />
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    </Elements>
    More reference:http://msdn.microsoft.com/en-us/library/office/ff407619(v=office.14).aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • 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;

  • Web cam does not override iSight camera. Any suggestions how to do so?

    I bought a Logitech webcam but cannot get it to work. The iSight camera comes on instead and overrides the web cam. Any way to fix this?

    If your Logitech webcam is Mac-compatible, it should be menu-selectable in the app you are using. Different camera apps work differently. Your Mac's Help in each application should give you more info on how each particular app works, but here are a few examples:
      • Messages:
      • Photo Booth:
      • FaceTime:
      • Skype:
      •   QuickTimeX:
    If your camera recognizes only one camera, apps may not display even the inbuilt camera in the menu.
    Different iMovie versions support different cameras in different ways.  Search your iMovie > Help for info on your version.

Maybe you are looking for