Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » java.lang.IllegalArgumentException: Argument not valid
java.lang.IllegalArgumentException: Argument not valid [message #448992] Mon, 17 January 2005 15:01 Go to next message
Eclipse UserFriend
Originally posted by: jimchiu2000.yahoo.com

I got the follow error when I use tableViewer

/* This is mainUI code */
public void createContent(){.....................

adultIncluded.setTicketNature("Adult ");
adultIncluded.setItem("Cable Car Round");
adultIncluded.setUnit("2");
adultIncluded.setPrice("100");
adultIncluded.setSubTotal("0");
System.out.println(adultIncluded.getTicketNature()+","+adultIncluded.getItem()+
","+adultIncluded.getUnit()+","+adultIncluded.getUnitPrice()+ ","+adultIncluded.getSubTotal());
System.out.println("adultIncluded:"+adultIncluded);

tableViewer.add(adultIncluded);
...................
}


Initally, the mainUI.java can run this tableviewer properly. however, when
I press the button of mainUI.java to open this window second time and then
press the button again... and then a error occurs.
ie.

final Button confirmButton = new Button(this, SWT.NONE);
confirmButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
close();
new MainUI();
}
});




java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:2677)
at org.eclipse.swt.SWT.error(SWT.java:2616)
at org.eclipse.swt.SWT.error(SWT.java:2587)
at org.eclipse.swt.widgets.Widget.error(Widget.java:381)
at org.eclipse.swt.widgets.TableItem.setImage(TableItem.java:90 9)
at
org.eclipse.jface.viewers.TableViewer.doUpdateItem(TableView er.java:221)
at
org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRun nable.run(StructuredViewer.java:128)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:616)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at
org.eclipse.jface.viewers.StructuredViewer.updateItem(Struct uredViewer.java:1374)
at org.eclipse.jface.viewers.TableViewer.add(TableViewer.java:1 16)
at org.eclipse.jface.viewers.TableViewer.add(TableViewer.java:1 34)
at MainUI.createContents(MainUI.java:762)
at MainUI.<init>(MainUI.java:128)
at MainUI.<init>(MainUI.java:98)
at MainUI$17.widgetSelected(MainUI.java:746)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
at MainUI.<init>(MainUI.java:101)
at MainUI$17.widgetSelected(MainUI.java:746)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
at MainUI.main(MainUI.java:87)
Re: java.lang.IllegalArgumentException: Argument not valid [message #449553 is a reply to message #448992] Wed, 26 January 2005 13:18 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
From your stack trace it looks like your provider is answering a disposed
Image as the image for a TableItem.

Grant

"Jim Chiu" <jimchiu2000@yahoo.com> wrote in message
news:csgk05$ain$1@www.eclipse.org...
> I got the follow error when I use tableViewer
>
> /* This is mainUI code */
> public void createContent(){.....................
>
> adultIncluded.setTicketNature("Adult ");
> adultIncluded.setItem("Cable Car Round");
> adultIncluded.setUnit("2");
> adultIncluded.setPrice("100");
> adultIncluded.setSubTotal("0");
>
System.out.println(adultIncluded.getTicketNature()+","+adultIncluded.getItem
()+
>
","+adultIncluded.getUnit()+","+adultIncluded.getUnitPrice()+ ","+adultInclud
ed.getSubTotal());
> System.out.println("adultIncluded:"+adultIncluded);
>
> tableViewer.add(adultIncluded);
> ...................
> }
>
>
> Initally, the mainUI.java can run this tableviewer properly. however, when
> I press the button of mainUI.java to open this window second time and then
> press the button again... and then a error occurs.
> ie.
>
> final Button confirmButton = new Button(this, SWT.NONE);
> confirmButton.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> close();
> new MainUI();
> }
> });
>
>
>
>
> java.lang.IllegalArgumentException: Argument not valid
> at org.eclipse.swt.SWT.error(SWT.java:2677)
> at org.eclipse.swt.SWT.error(SWT.java:2616)
> at org.eclipse.swt.SWT.error(SWT.java:2587)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:381)
> at org.eclipse.swt.widgets.TableItem.setImage(TableItem.java:90 9)
> at
> org.eclipse.jface.viewers.TableViewer.doUpdateItem(TableView er.java:221)
> at
>
org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRun nable.run(Struct
uredViewer.java:128)
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:616)
> at org.eclipse.core.runtime.Platform.run(Platform.java:747)
> at
>
org.eclipse.jface.viewers.StructuredViewer.updateItem(Struct uredViewer.java:
1374)
> at org.eclipse.jface.viewers.TableViewer.add(TableViewer.java:1 16)
> at org.eclipse.jface.viewers.TableViewer.add(TableViewer.java:1 34)
> at MainUI.createContents(MainUI.java:762)
> at MainUI.<init>(MainUI.java:128)
> at MainUI.<init>(MainUI.java:98)
> at MainUI$17.widgetSelected(MainUI.java:746)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
> at MainUI.<init>(MainUI.java:101)
> at MainUI$17.widgetSelected(MainUI.java:746)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2772)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2431)
> at MainUI.main(MainUI.java:87)
>
Previous Topic:Attaching SWT/JFace sources to a project while debugging
Next Topic:Simple Data Binding
Goto Forum:
  


Current Time: Sat Nov 16 21:29:58 GMT 2019

Powered by FUDForum. Page generated in 0.03061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top