Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Java Swing jCheckbox creation from an external file, and not using a "GUI Builder"??

Thread view: 
henderjm@gmail.com - 03 Aug 2006 22:49 GMT
Does anyone know how to create a bunch of jCheckboxes based off of some

XML file?  I'm trying to add some checkboxes in a jPanel, but can't
figure out how.
The XML file would probably look similar to:
<?xml version="1.0"?>
<SAMPLES>
<SAMPLE ID="1">
   <Name>Some Name</Name>
   <Description>Some Descr</Description>
   <Additional_Info>Some info</Additional_Info>
   <Warning_Level>0 through 5</Warning_Level>
   <Warning_Description>Some Warning description</Warning_Description>

 </SAMPLE>
  <SAMPLE ID="2">
   <Name>Some Other Name</Name>
   <Description>Some Other Descr</Description>
   <Additional_Info>Some Other info</Additional_Info>
   <Warning_Level>0 through 5</Warning_Level>
   <Warning_Description>Some Other Warning
description</Warning_Description>
 </SAMPLE>
</SAMPLES>
Joshua - 03 Aug 2006 23:38 GMT
> Does anyone know how to create a bunch of jCheckboxes based off of some
>
> XML file?  I'm trying to add some checkboxes in a jPanel, but can't
> figure out how.

I don't know the details of accessing XML through Java (I've only done it
through JavaScript), but you should check out these tutorials:
http://java.sun.com/docs/books/tutorial/uiswing/index.html (Go to the
components and find the checkbox tutorial)
http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/index.html
(This is the XML Processing tutorial -- it's a lot easier than wading
through the API yourself).

Also the packages you (may) need to be concerned about:
javax.xml
javax.xml.parsers
org.w3c.dom
henderjm@gmail.com - 04 Aug 2006 02:22 GMT
thanks for the effort, but I don't think that will help me.  The
example they have for DOM is a JTree which is only one object with the
leafs and nodes being the XML portion, and I need to create many
objects that are based off of the XML file.

> > Does anyone know how to create a bunch of jCheckboxes based off of some
> >
[quoted text clipped - 13 lines]
> javax.xml.parsers
> org.w3c.dom
Andrew Thompson - 04 Aug 2006 03:07 GMT
> thanks for the effort, but ...

Please refrain from top-posting & multi-posting.
<http://groups.google.com/groups/search?enc_author=eegReBIAAAAW7Uah0FgiA3xlLOgJcq
-V8rhlH0Pnl47z4AZhN98BFg&scoring=d
>

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.