Paul Clapham wrote:What is the size of the "class2" component when it's displayed? (By the way "class2" is a horrible name for a class.) Perhaps your drawing is taking place outside its bounds. Or perhaps its size is zero.
Well, i overwrote the name of the class for this example. the classes have tons of code implemented in it so i just explained my issue in a simpler matter. (no,the class is not called class2, no,the paint function is not empty :-P )
However,thanks for pointing the size,i completely forgot about it,it wasn't set at all.however,that wasn't the issue.By directly calling the func inside my paint method ,the text is displayed ( class2 object .paintComponent(g); )
Actually this entire issue has been caused because i am trying to find a way to use a function to draw on the screen only when i am telling it to do so ( and without using the paint from a super class so i wont require to go through an if statement on each call until it reaches his purpose).However, the problem is with the Graphics argument,apparently ,because i require it in order to do the painting and the only place i can drag him as an argument is within the paint function..any ideas how i could do it without ?