I am cleaning my code. I read that I putting the ActionListener
is another class is better. So that's what I did.
But in my ActionListener
, everything works except at some point in the code, I got a setSize(xx,xx)
. I worked before because it was in the same class. But not anymore. I've tried multiple solutions but I couldn't figure it out.
ActionListener
:
public class ActionFrame implements ActionListener{
public void actionPerformed(ActionEvent e){
Object src = e.getSource();
if(src == Frame.Console_Bouton){
System.out.println("Bouton console");
if(getSize().getWidth() >= 750){
/** If True (Retirer) */
for(int i = 1090; i > 689; i--){
setSize(i, 490);
System.out.println("Rétractation du Frame");
}
}else{
/** If False (Etirer) */
for(int i = 689; i < 1090; i++){
setSize(i, 490);
System.out.println("Etirage du Frame");
}
}
}
...
As for errors, there are none, it will just freeze the program.