When I select sub-menu "Search Photos" from class testUserInterface, a search panel is displayed with textfield and 2 buttons, start and exit.
However, a problem occurs when I clicks start button (after entering a specific keyword).
all photos which relates to the keyword is not shown.
and I got problem with sub-menu instead in line 180.
Please help me out with the problem, it drives me crazy (TT)
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
4
posted
0
The Exception tells it all. You are trying to cast a JButton to a JMenuItem, which you cannot do. They are different classes. Why do you want such casts in the first place?
luck, db
There are no new questions, but there may be new answers.
Hung Pham
Greenhorn
Joined: Dec 12, 2012
Posts: 3
posted
0
Thank you to Campbell Ritchie,
I am quite new to Java and got help with getActionCommand() from another mate.
@Darryl Burke
Sorry, I did not notice about "Be Forthright When Cross Posting To Other Sites" from java-forums.org
I thought all website run individually and much faster If I post the same question in different 4rums.
Sorry in advance
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
4
posted
0
Hung Pham wrote:Thank you to Campbell Ritchie,
I am quite new to Java and got help with getActionCommand() from another mate.
. . .
Did you say help? If you have been told to use a great big actionPerformed method with lots of if statements, that is not help at all. You should be linking different Listeners to different buttons. Work out how to do it with one Listener per button, then you can help him back. And it will really be help
This discussion would fit better in our GUIs forum: moving.
Hung Pham
Greenhorn
Joined: Dec 12, 2012
Posts: 3
posted
0
Could admin remove this topic please, it is not needed any more and it is also crossing post with other 4rums.
thanks a lot
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
4
posted
0
Hung Pham wrote:Could admin remove this topic please, . .