Menu

#2 NoSuchMethodException when using TableColumn.setWidth()

open
nobody
client-side (2)
5
2004-11-16
2004-11-16
Anonymous
No

(at least I think it is client-side)

the code that produced the Exception:

/*
* ...
*/

Table table = new Table(shell, SWT.BORDER |
SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);

TableColumn col1 = new TableColumn(table,SWT.NONE,0);
/*
* ...
* creating more TableColumns
* ...
*/

col1.setWidth(100); // this one throws the Exception

end of code listing

complete StackTrace of the Exception:

Exception in thread "main"
net.sourceforge.rswt.RSWTException: null; nested
exception is:
java.lang.NoSuchMethodException:
net.sourceforge.rswt.toolkits.swt.widgets.TableColumnPeer.getWidth(java.lang.Integer)
java.lang.NoSuchMethodException:
net.sourceforge.rswt.toolkits.swt.widgets.TableColumnPeer.getWidth(java.lang.Integer)
at java.lang.Class.getMethod(Class.java:1581)
at
net.sourceforge.rswt.toolkits.swt.RSWTServerCallRequest.run(RSWTServerCallRequest.java:58)
at
net.sourceforge.rswt.toolkits.swt.SwtToolkit.call(SwtToolkit.java:239)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at
sun.rmi.transport.Transport$1.run(Transport.java:153)
at
java.security.AccessController.doPrivileged(Native Method)
at
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)

end of StackTrace

SOLUTION:

I think it is fixed if you replace setWidth(int width) in

rswt-0.1.0\src\java\org\eclipse\swt\widgets\TableColumn.java

with

public void setWidth (int width)
{
callClient("setWidth", width);
}

original:

public void setWidth (int width)
{
callClient("getWidth", width);
}

I am not sure whether this will fix it since I didn't
verify it

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.