posted 17 years ago
Hi, yesterday I have tested the code and I have found where the problem is, but I don't know yet, how can I solve the problem. I post the source code up. The code is really a little bit complex. I try to explain it clearly. There are 2 classes. One is a abstract basic class, named GraphGame. The other is subclass, named TSPGame. The problem is in the first basic class, GraphGame. Its main function is to make the User Graphic Interface. What I have found is all because this code: 'contentPane.add(_p, BorderLayout.CENTER);', the line 157. _p is a panel, this panel ist the container of other elements. I put the other elements onto this panel, and then put this panel into JApplet. But whenever I add the panel _p on the JApplet, this panel will cover the submenus up. Whenever I delete this line, the submenus will be appeared, (the mainmenu can always be seen). That is, when I add the panel onto JApplet and then click the mainmenu, the submenu works, but we can not see them, because they are covered by the panel _p. when I change the code like this: 'contentPane.add(_p, BorderLayout.EAST);', then we can see all the submenus, and the panel is on the right side of the JApplet. Of cause, this is not the way to solve the problem and there must be anything wrong with these elements.
Weil die Code nicht von mir gemacht wird, habe ich sie gel�scht.
[ May 21, 2006: Message edited by: Baosheng Ma ]