Help me on this Form please

Hello,
i have design this form, i have place 3 values(Aus,Greece,Ireland) in Combo Box. I want to go on next form whenever i click on any one of these values but i unable to this action. For examp, when i click on Greece, it should go on next form which contain information about the Greece. Can somebody help me on this ? please.... here is the code in working condition....

For examp, when i click on Greece, it should go on next form which contain information about the Greece. Can somebody help me on this ?

What do you mean by "go on next form"? Do you mean open a dialog window of some sort with a display of information? Do you mean have your main JFrame swap displays so that now it is showing another JPanel that displays country information? You need to be a bit more clear here I think.

Also, when posting code, if you use code tags, your code will be more readable and this will increase the number of folks willing to read your question and think about your code -- something that you want to have happen. So you may want to edit your post and place the tag [cod&#101;] on top of your code block and the tag [/cod&#101;] below your code block.

I glanced through the code quickly, but I didn't see any event listeners attached to the combo box. I can't remember the exact one, but you want to listen for item selection events. When you get an event, you then display the next form.

I suggest you find an introductory tutorial on Model-View-Controller programming in Java. Even with little projects, doing it "right" ends up taking a lot less time than stringing code together. It should cover events and listeners. This is a place where Java is powerful but complicated. Take the time to learn how it works, and, again, you'll end up taking a lot less time.

Actually he does have an ActionListener added to the combobox that in its actionPerformed method prints out some debugging information to let him know that an item was selected. Based on the look of his program, I'm assuming that the real action should occur when the button is pressed.

To the original poster, you would do well to study the Sun Swing Tutorials on how to respond to actions and also the tutorials on how to create and display dialogs. You can find both of them here:

Here's a quickly thrown together example that uses a DefaultComboBoxModel to hold objects of a class called CountryInfo. These objects hold two strings: the country's name and a url string that points to an online site that holds information on the country. When the selectCountryBtn is pressed, it will get the CountryInfo object out of the model, and use it to place the desired web page into a JEditorPane called infoPane.