Yes that works but the problem I am having is changing the cardlayout from another class, that is a different file.
I modifyed your code.
main code
package cardlayouttest;
import...
Type: Posts; User: kinkita
Yes that works but the problem I am having is changing the cardlayout from another class, that is a different file.
I modifyed your code.
main code
package cardlayouttest;
import...
I managed to acces the class method "changeToGame". I added a System.out text to see if it worked and it did, but when I add the code "cardlayout.show(cardPanel, "2");" this error message comes up:
I created the method "changeToGame()" in the class "TicTacToe" but I can't manage to acces it through other classes.
I can't do: TicTacToe tac = new TicTacToe();
tac.changeTogame();
since...
Sorry it took me a while to respond(my internet was just too slow)
Okey looked at the cardlayout functions, found an example, and now I have this:
main code:
package tictactoe;
import...
Hello everyone, I have once again aproached a problem on my journey to Java.
What I want to do:
I want to be able to remove a Jpanel from the main class but with another class. I'll try to show...