From: Kevin B. <kb...@ca...> - 2001-11-30 17:57:04
|
I think you'll probably need to describe what the behavior is when it doesn't work. The following: from javax.swing import JButton x = JButton() w= x.width + 10 h= x.height + 10 x.preferredSize = w,h print x.preferredSize Gives the expected output: java.awt.Dimension[width=10,height=10] Pure speculation: try printing type( w ) - is it a PyInteger? kb Edward Povazan wrote: > > Hi, > > Anyone know what is going on here? I am setting preferredSize on a JButton. > This doesn't work: > w=self.__tree.width > h=self.__nodeRenderer.preferredSize.height > self.__nodeRenderer.preferredSize = w,h > Changing the last line > self.__nodeRenderer.preferredSize = 300,h > works. > > How is this possible? Also, a print statement prints the correct value in > both cases. Very strange. > > Thanks > -Ed > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |