AllExperts > Experts 
Search      

Java

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Java Answers
Question Library

Ask a question about Java
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Artemus 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#
 
   

You are here:  Experts > Computing/Technology > Focus on Java > Java > passing arguments between frames

Topic: Java



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.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.