Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Make JComboBox fill with id's from xml file

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Make JComboBox fill with id's from xml file

    If I have an xml file and it's full of different environments and I want to display them in a drop down list - how would I do that?

    The xml in file is simply just:

    <Environment id = " database 1">
     
    //xml elements in environment
     
    </Environment>

    xml file is just called XmlFile.xml


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Make JComboBox fill with id's from xml file

    See the tutorial for how to use a JComboBox: How to Use Combo Boxes (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. xml file in JAR archive vs xml in classes folder
    By n0hc in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 2nd, 2013, 09:44 PM
  2. convert excel to xml and read the input from xml file
    By rahulruns in forum Object Oriented Programming
    Replies: 5
    Last Post: April 3rd, 2012, 11:13 AM
  3. How do we fill in an array using substring, FileReader and a txt file?
    By wholegrain in forum Java Theory & Questions
    Replies: 5
    Last Post: February 12th, 2012, 03:18 PM
  4. Reading XML File using DOMParser and have problem with accessing xml
    By optiMystic23 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 21st, 2012, 02:22 PM
  5. [SOLVED] Write an xml dom to a xml file
    By Kakashi in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: March 2nd, 2011, 03:30 PM

Tags for this Thread