Originally Posted by
vitorloke
i mean just want to set (200,100) and (300,200)
If I'm getting it right you want to set the size (200,100) the first time the button is clicked, (300,200) the second time so on.
So if you want to do this with one button only you can use the index value in the
actionPerformed() method you have with the following logic;
if (index is even)*
setSize(200, 100);
else
setSize (300, 100);
increment index by one
*You can either test if the index is odd instead of even.
Hint: an int x is even when
x % 2 == 0.