Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » IllegalArgumentExceptions in VE
IllegalArgumentExceptions in VE [message #82326] Mon, 07 March 2005 14:20 Go to next message
Eclipse UserFriend
Originally posted by: R.Kratz.exec-software.de

Hi.

I have a toolbar with some buttons. But when I add an icon to a
toolbar-button
(
URL url = getClass().getResource("img/ball_green_off.gif");
jButton1.setIcon(new ImageIcon(url));
)
, the warning-icon appears on the button with the following text:
icon : java.lang.IllegalArgumentException (IWAV0177E Expression "url" is
too complicated. - new ImageIcon(url))

The url-path is quite short and the icon can be found. I added the same
icon to a menuItem, without getting such a warning.

Could this be a bug in the VE?

Another IllegalArgumentException appears in a scrollpane with contains a
tree. When I put the standard tree control from the palette into the
scrollpane (generated code is: jScrollPane.setViewportView(getJTree());),
the tree is shown without exception. but when I create my own tree and
change the default code in the getJTree-Method
(jTree = new JTree();) to the following
(
DefaultMutableTreeNode top =
new DefaultMutableTreeNode("Root Node");
jTree = new JTree(top);
),
the tree cannot be painted in the ve anymore and a warning with an
illegalArgumentException occurs with the following text:
viewportView : java.lang.IllegalArgumentException (IWAV0167E Currently
methods need receiver (getJTree))

Can you explain this?

Many thanks,
Rebecca
Re: IllegalArgumentExceptions in VE [message #82401 is a reply to message #82326] Mon, 07 March 2005 15:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Rebecca Kratz wrote:
> Hi.
>
> I have a toolbar with some buttons. But when I add an icon to a
> toolbar-button
> (
> URL url = getClass().getResource("img/ball_green_off.gif");
> jButton1.setIcon(new ImageIcon(url));
> )
> , the warning-icon appears on the button with the following text:
> icon : java.lang.IllegalArgumentException (IWAV0177E Expression "url" is
> too complicated. - new ImageIcon(url))
>
What version are you using (I think this will work as of 1.0.2) if you
add this to the URL url line:

> URL url = getClass().getResource("img/ball_green_off.gif"); // @jve

But this may not work either because it is a separate variable and to us
it doesn't look like a "new" instance (i.e. new SomeClass()). If
you had done jButton1.setIcon(new ImageIcon(getClass()....) instead, I
think that will work because we put special code in for the ImageIcon
constructor to handle this.

> The url-path is quite short and the icon can be found. I added the same
> icon to a menuItem, without getting such a warning.
>
> Could this be a bug in the VE?
>
> Another IllegalArgumentException appears in a scrollpane with contains a
> tree. When I put the standard tree control from the palette into the
> scrollpane (generated code is:
> jScrollPane.setViewportView(getJTree());), the tree is shown without
> exception. but when I create my own tree and change the default code in
> the getJTree-Method (jTree = new JTree();) to the following (
> DefaultMutableTreeNode top =
> new DefaultMutableTreeNode("Root Node");
> jTree = new JTree(top);
> ), the tree cannot be painted in the ve anymore and a warning with an
> illegalArgumentException occurs with the following text: viewportView :
> java.lang.IllegalArgumentException (IWAV0167E Currently methods need
> receiver (getJTree))

This is more complicated than we currently can handle. Again try putting
// @jve on the DefaultMutableTreeNode top = line so that we know top
is something of importance.
>
> Can you explain this?
>
> Many thanks,
> Rebecca
>
>

--
Thanks,
Rich Kulp
Re: IllegalArgumentExceptions in VE [message #82747 is a reply to message #82401] Tue, 08 March 2005 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: R.Kratz.exec-software.de

Hi Rich.

Thanks for your help. The //@jve-command doesn't work in version 1.0.2,
I'm afraid. But I've written the url-term directly into the parameters of
the ImageIcon-constructor. Then the designer can resolve it. The same I
did with the tree-constructor (jTree = new JTree(new
DefaultMutableTreeNode("Root"));). With the help of the method
tree.getModel().getRootNode() you can access the rootNode in the
createNodes-method with is then called later.

> Rebecca Kratz wrote:
>> Hi.
>>
>> I have a toolbar with some buttons. But when I add an icon to a
>> toolbar-button
>> (
>> URL url = getClass().getResource("img/ball_green_off.gif");
>> jButton1.setIcon(new ImageIcon(url));
>> )
>> , the warning-icon appears on the button with the following text:
>> icon : java.lang.IllegalArgumentException (IWAV0177E Expression "url" is
>> too complicated. - new ImageIcon(url))
>>
> What version are you using (I think this will work as of 1.0.2) if you
> add this to the URL url line:

> > URL url = getClass().getResource("img/ball_green_off.gif"); // @jve

> But this may not work either because it is a separate variable and to us
> it doesn't look like a "new" instance (i.e. new SomeClass()). If
> you had done jButton1.setIcon(new ImageIcon(getClass()....) instead, I
> think that will work because we put special code in for the ImageIcon
> constructor to handle this.

>> The url-path is quite short and the icon can be found. I added the same
>> icon to a menuItem, without getting such a warning.
>>
>> Could this be a bug in the VE?
>>
>> Another IllegalArgumentException appears in a scrollpane with contains a
>> tree. When I put the standard tree control from the palette into the
>> scrollpane (generated code is:
>> jScrollPane.setViewportView(getJTree());), the tree is shown without
>> exception. but when I create my own tree and change the default code in
>> the getJTree-Method (jTree = new JTree();) to the following (
>> DefaultMutableTreeNode top =
>> new DefaultMutableTreeNode("Root Node");
>> jTree = new JTree(top);
>> ), the tree cannot be painted in the ve anymore and a warning with an
>> illegalArgumentException occurs with the following text: viewportView :
>> java.lang.IllegalArgumentException (IWAV0167E Currently methods need
>> receiver (getJTree))

> This is more complicated than we currently can handle. Again try putting
> // @jve on the DefaultMutableTreeNode top = line so that we know top
> is something of importance.
>>
>> Can you explain this?
>>
>> Many thanks,
>> Rebecca
>>
>>
Re: IllegalArgumentExceptions in VE [message #112243 is a reply to message #82326] Thu, 01 December 2005 23:38 Go to previous message
Eclipse UserFriend
Originally posted by: diego.toth.it

I don't know if that can be useful, but I've encountered error IWAV0167E and the solution was deleting the comment on the last code line; in my case, the line was

} // @jve:decl-index=0:visual-constraint="14,18"


I've found the solution simply creating a new Swing JFrame and analyzing the differences.

Ciao
Re: IllegalArgumentExceptions in VE [message #605706 is a reply to message #82326] Mon, 07 March 2005 15:04 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Rebecca Kratz wrote:
> Hi.
>
> I have a toolbar with some buttons. But when I add an icon to a
> toolbar-button
> (
> URL url = getClass().getResource("img/ball_green_off.gif");
> jButton1.setIcon(new ImageIcon(url));
> )
> , the warning-icon appears on the button with the following text:
> icon : java.lang.IllegalArgumentException (IWAV0177E Expression "url" is
> too complicated. - new ImageIcon(url))
>
What version are you using (I think this will work as of 1.0.2) if you
add this to the URL url line:

> URL url = getClass().getResource("img/ball_green_off.gif"); // @jve

But this may not work either because it is a separate variable and to us
it doesn't look like a "new" instance (i.e. new SomeClass()). If
you had done jButton1.setIcon(new ImageIcon(getClass()....) instead, I
think that will work because we put special code in for the ImageIcon
constructor to handle this.

> The url-path is quite short and the icon can be found. I added the same
> icon to a menuItem, without getting such a warning.
>
> Could this be a bug in the VE?
>
> Another IllegalArgumentException appears in a scrollpane with contains a
> tree. When I put the standard tree control from the palette into the
> scrollpane (generated code is:
> jScrollPane.setViewportView(getJTree());), the tree is shown without
> exception. but when I create my own tree and change the default code in
> the getJTree-Method (jTree = new JTree();) to the following (
> DefaultMutableTreeNode top =
> new DefaultMutableTreeNode("Root Node");
> jTree = new JTree(top);
> ), the tree cannot be painted in the ve anymore and a warning with an
> illegalArgumentException occurs with the following text: viewportView :
> java.lang.IllegalArgumentException (IWAV0167E Currently methods need
> receiver (getJTree))

This is more complicated than we currently can handle. Again try putting
// @jve on the DefaultMutableTreeNode top = line so that we know top
is something of importance.
>
> Can you explain this?
>
> Many thanks,
> Rebecca
>
>

--
Thanks,
Rich Kulp
Re: IllegalArgumentExceptions in VE [message #605752 is a reply to message #82401] Tue, 08 March 2005 10:20 Go to previous message
Eclipse UserFriend
Originally posted by: R.Kratz.exec-software.de

Hi Rich.

Thanks for your help. The //@jve-command doesn't work in version 1.0.2,
I'm afraid. But I've written the url-term directly into the parameters of
the ImageIcon-constructor. Then the designer can resolve it. The same I
did with the tree-constructor (jTree = new JTree(new
DefaultMutableTreeNode("Root"));). With the help of the method
tree.getModel().getRootNode() you can access the rootNode in the
createNodes-method with is then called later.

> Rebecca Kratz wrote:
>> Hi.
>>
>> I have a toolbar with some buttons. But when I add an icon to a
>> toolbar-button
>> (
>> URL url = getClass().getResource("img/ball_green_off.gif");
>> jButton1.setIcon(new ImageIcon(url));
>> )
>> , the warning-icon appears on the button with the following text:
>> icon : java.lang.IllegalArgumentException (IWAV0177E Expression "url" is
>> too complicated. - new ImageIcon(url))
>>
> What version are you using (I think this will work as of 1.0.2) if you
> add this to the URL url line:

> > URL url = getClass().getResource("img/ball_green_off.gif"); // @jve

> But this may not work either because it is a separate variable and to us
> it doesn't look like a "new" instance (i.e. new SomeClass()). If
> you had done jButton1.setIcon(new ImageIcon(getClass()....) instead, I
> think that will work because we put special code in for the ImageIcon
> constructor to handle this.

>> The url-path is quite short and the icon can be found. I added the same
>> icon to a menuItem, without getting such a warning.
>>
>> Could this be a bug in the VE?
>>
>> Another IllegalArgumentException appears in a scrollpane with contains a
>> tree. When I put the standard tree control from the palette into the
>> scrollpane (generated code is:
>> jScrollPane.setViewportView(getJTree());), the tree is shown without
>> exception. but when I create my own tree and change the default code in
>> the getJTree-Method (jTree = new JTree();) to the following (
>> DefaultMutableTreeNode top =
>> new DefaultMutableTreeNode("Root Node");
>> jTree = new JTree(top);
>> ), the tree cannot be painted in the ve anymore and a warning with an
>> illegalArgumentException occurs with the following text: viewportView :
>> java.lang.IllegalArgumentException (IWAV0167E Currently methods need
>> receiver (getJTree))

> This is more complicated than we currently can handle. Again try putting
> // @jve on the DefaultMutableTreeNode top = line so that we know top
> is something of importance.
>>
>> Can you explain this?
>>
>> Many thanks,
>> Rebecca
>>
>>
Re: IllegalArgumentExceptions in VE [message #611440 is a reply to message #82326] Thu, 01 December 2005 23:38 Go to previous message
Eclipse UserFriend
Originally posted by: diego.toth.it

I don't know if that can be useful, but I've encountered error IWAV0167E and the solution was deleting the comment on the last code line; in my case, the line was

} // @jve:decl-index=0:visual-constraint="14,18"


I've found the solution simply creating a new Swing JFrame and analyzing the differences.

Ciao
Previous Topic:New data binding framework - is it working?
Next Topic:java.lang.NullPointerException duting open VE
Goto Forum:
  


Current Time: Thu Apr 25 12:31:26 GMT 2024

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

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

Back to the top