Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Default Link between JComboBox variables

    Hello,

    I want to create multiple dorpdownlists in a JApplet.
    For example
    Dropdownlist A, containing: A1, A2, A3
    Dropdownlist B, containing: B1, B2, B3
    Dropdownlist C, containing: C1, C2, C3

    What I want to create, is that when I select A1 in Dropdownlist A, list B and C automatically show B1 and C1. The same when I select B2, list A and C automatically show A2 and C2. etc...

    How should I do this? I think I need to declare JComboBoxes for the dropdownlist right? But how about the automatic selection "Link" between the dropdown lists? What kind of listeners are needed for this? And do I need to make use of the repaint method or something to automatically refresh the JApplet with all new items in de dropdown lists?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,238
    Rep Power
    19

    Default

    Read the API for JComboBox and follow the link to the Swing tutorial on How to Use Combo Boxes, where you will find the answers to your questions. Once you have some code that attempts to meet the requirement, feel free to ask a specific question about any problems.

    If you do it correctly, you won't have any need to call repaint().

    db

Similar Threads

  1. link for Jcreator
    By rajivjoshi in forum New To Java
    Replies: 3
    Last Post: 05-31-2010, 10:10 AM
  2. Replies: 2
    Last Post: 12-10-2009, 01:58 PM
  3. What are Instance variables and static variables?
    By sandeshforu in forum New To Java
    Replies: 3
    Last Post: 09-09-2009, 05:48 PM
  4. Link for 64 bit JDK.
    By aparna in forum New To Java
    Replies: 0
    Last Post: 03-19-2008, 02:15 PM
  5. Link List
    By one198 in forum New To Java
    Replies: 0
    Last Post: 10-14-2007, 01:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •