Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: java.lang.IllegalArgumentException: Identifier not found

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default java.lang.IllegalArgumentException: Identifier not found

    I'm completely confused as to what is happening here. There error is when i make the super call in the constructor. What is happening?

    My error is: java.lang.IllegalArgumentException: Identifier not found

    public class ButtonEditor extends DefaultCellEditor
    	{
    		protected JButton button;
    		private String label;
    		private boolean isPushed;
    		public ButtonEditor(JCheckBox checkBox)
    		{
    			super(checkBox);
    			System.out.println("Check1");
    			button = new JButton();
    			button.setOpaque(true);
    			button.addActionListener(new ActionListener(){
    				public void actionPerformed(ActionEvent e)
    				{
    					fireEditingStopped();
    				}
    			});
    			System.out.println("Check2");
    		}
    		public Component getTableCellEditorComponent(JTable table, Object value,boolean isSelected, int row, int column)
    		{
    			if (isSelected)
    			{
    				button.setForeground(table.getSelectionForeground());
    				button.setBackground(table.getSelectionBackground());
    			}
    			else
    			{
    				button.setForeground(table.getForeground());
    				button.setBackground(table.getBackground());
    			}
    			label = (value ==null) ? "" : value.toString();
    			button.setText( label );
    			isPushed = true;    return button;
    		}
    		public Object getCellEditorValue()
    		{
    			if (isPushed)
    			{
    				System.out.println(label + ": Ouch!");
    			}
    			isPushed = false;
    			return new String( label ) ;
    		}
    		public boolean stopCellEditing()
    		{
    			isPushed = false;
    			return super.stopCellEditing();
    		}
    		protected void fireEditingStopped()
    		{
    			super.fireEditingStopped();
    		}
    	}


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    Please post the full text of the error message. You have left off important info.
    Please copy full text of error message and paste it here. Here is a sample:
    TestSorts.java:138: cannot find symbol
    symbol  : variable var
    location: class TestSorts
             var = 2;
             ^

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    It was a runtime. That was all I got...

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    No stack trace? Only one line?

    Is your code suppressing the stack trace?
    Can you change it to give a stack trace?
    Last edited by Norm; July 30th, 2010 at 12:43 PM.

  5. #5
    Junior Member
    Join Date
    Jul 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    When I ran your code with a small test program I wrote I didn't receive an error:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestButtonEditor
    {
    	public static void main(String[] args)
    	{
    		ButtonEditor be = new ButtonEditor(new JCheckBox());
    	}
    }

    This was my output:
    Check1
    Check2

    Hunter

  6. #6
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    I've actually moved past this, but for curiosity reasons, my call to ButtonEditor was:
    table.getColumn(3).setCellEditor(new ButtonEditor(new JCheckBox()));

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    Is your problem now solved?

  8. #8
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    Quote Originally Posted by Norm View Post
    Is your problem now solved?
    Not solved, more ignored. I took my code on a detour. However, I am still curious as to what would have caused the IllegalArgumentException at runtime. Might run into it again sometime in the future and I'd like to know how to deal with it.

  9. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: java.lang.IllegalArgumentException: Identifier not found

    I never saw the stack trace. Was there one or did your code suppress it?

  10. #10
    Junior Member
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Re: java.lang.IllegalArgumentException: Identifier not found

    I have the same Problem with my Table. I want to insert a JCombobox in the row in the left, but i also recieve an IllegalArgumentException. Here is the code of the Class TableGUI:

            ComboBoxModel cbModel = new DefaultComboBoxModel(Article.articleType.values());
            JComboBox cbx_auswahl = new JComboBox(cbModel);
            cbx_auswahl.setModel(cbModel);
            TableAdapter adapter = new TableAdapter(dataVector);
            tbl_content = new JTable(adapter);
            tbl_content.setRowHeight(30);
            tbl_content.setAutoCreateRowSorter(true);
            tbl_content.getTableHeader().setReorderingAllowed(false);
            tbl_content.getColumn(TableAdapter.AT_COLUMN).setCellEditor(new ComboBoxEditor(cbx_auswahl));
            c.add(tbl_content);

    now here is the Exception:

    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Identifier not found
    at javax.swing.table.DefaultTableColumnModel.getColum nIndex(Unknown Source)
    at javax.swing.JTable.getColumn(Unknown Source)
    at GUI_JAXB.TableGUI.<init>(TableGUI.java:75)
    at GUI_JAXB.ImportGUI.actionPerformed(ImportGUI.java: 105)
    at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

    ...
    Last edited by ahunzs; March 9th, 2012 at 07:11 AM.

Similar Threads

  1. IllegalArgumentException: Pan not supported
    By rtumatt in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: June 13th, 2010, 01:00 PM
  2. AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    By nasi in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 25th, 2010, 10:37 PM
  3. Replies: 2
    Last Post: January 8th, 2010, 08:22 AM
  4. Replies: 2
    Last Post: November 3rd, 2009, 06:28 AM
  5. [SOLVED] Java error "Another <identifier> expected"
    By bruint in forum What's Wrong With My Code?
    Replies: 23
    Last Post: May 1st, 2009, 08:47 AM