AboutArtemus Harper Expertise I have a BS in computer science and am working towards a Masters degree.
Experience I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection, and Java java.nio.*
knowledge of Java bytecode and annotations.
Basics in c++ and c#
Expert: Artemus Harper Date: 6/21/2008 Subject: passing arguments between frames
Question Hi
I am trying to write a code in java to do the following:
i got an interface for the user, it contains a combobox which is a list of costumers, and a button to add a new costumer below it, once u press that button you get a new interface (B) to add a new costumers details.
What i want to do is, once the costumers enters details for the new costumer and presses submit, the frame B gets hidden and the new costumer that the user just entered appears in the combobox in frame A
i am using java and connecting to a mySQL database
Thanks in advance
Regards
Mahiou
Answer When they hit submit you can either hide or dispose of the frame (depending if you plan to use it again or not). Then you can call addItem(...) on the jcombobox to add an item. If you are using the DefaultComboBoxModel then you can add any item, and the item will be converted to a String using the toString() method.