Thanks for all the great advice!
right, so the real problem. The constructor of ResPanel didn't get called at all...
The first thing I tried is changing
ResPanel r = new ResPanel();
to
JPanel r = new ResPanel();
but it stay the same.
I could change the whole code up and make it work in another way, but I really want to keep the existing structure of the code.
is there something I am missing for me to call that constructor? do I need a getter method like
public ResPanel getResPanel(){
return new ResPanel();
}
or ...
===========
okay i was typing all that and suddenly I found out what is wrong D:
my code was almost perfect....except....THERE IS A FREAKING VOID IN MY CONSTRUCTOR D:
i must have been thinking about I need to add void because it returns nothing...
I removed the void tag and my codes runs fine now.
@copeg
thanks for the hint lol..I keep focusing on the main method and trying to find what's wrong and I totally forgot about the constructor.