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 / GUI / June 2004

Tip: Looking for answers? Try searching our database.

Swing JPanel generator from class (for class attribute editing)

Thread view: 
John Abraham - 24 Jun 2004 21:23 GMT
Is there any tool (public domain or otherwise) that will generate
JPanels or JDialogs to edit the attributes of a class?  A default
instance editor?

I've looked at many of the GUI builders, and for the most part I think
I prefer to hand code my GUI code.  But it would be nice to have an
initial implementation to start with -- a JTextField in the
view-controller for every String in the model, a  JTable for every
array or ArrayList in the model, a button for every class reference
variable that would open a dialog for that class, a checkbox for every
boolean, etc.

It seems like it would be easy to generate such code.  It must be,
because I keep typing the same mindless things over and over.

--
John Abraham
jabraham (at) ucalgary (dot) ca
Roedy Green - 24 Jun 2004 22:13 GMT
>Is there any tool (public domain or otherwise) that will generate
>JPanels or JDialogs to edit the attributes of a class?  A default
[quoted text clipped - 10 lines]
>It seems like it would be easy to generate such code.  It must be,
>because I keep typing the same mindless things over and over.

I call those things stompers. I have posted code for them and got a
rain of cabbages for wasting bandwidth.  I you send me an unmunged
email I will send you mine you can tweak for yourself.  I don't
release them as products since they are not usable without tuning for
your own circumstances.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

John Abraham - 26 Jun 2004 18:01 GMT
> >Is there any tool (public domain or otherwise) that will generate
> >JPanels or JDialogs to edit the attributes of a class?  A default
> >instance editor?

> I call those things stompers. I have posted code for them and got a
> rain of cabbages for wasting bandwidth.  I you send me an unmunged
> email I will send you mine you can tweak for yourself.  I don't
> release them as products since they are not usable without tuning for
> your own circumstances.

Ok, cool, thanks.  I'll email you directly.

Interestingly when searching google I found that I posted virtually
the same post in June of 1999, 5 years ago!  The more things change...

http://groups.google.ca/groups?q=group:*java*+jabraham&hl=en&lr=&ie=UTF-8&selm=7
jq16t%24e9u%40ds2.acs.ucalgary.ca&rnum=1


--
John
jabraham (at) ucalgary (dot) ca
Will Hartung - 24 Jun 2004 22:15 GMT
> Is there any tool (public domain or otherwise) that will generate
> JPanels or JDialogs to edit the attributes of a class?  A default
> instance editor?

I can't think of any specific examples, but there may be something
"stealable" from any of the IDEs that let you edit JavaBean components,
because that's basically the same thing.

Most seem to use a JTable for the entire thing.

Other than that, it's a pretty a simple matter to hack something out using
reflection. Layout is always a detail, plus label names and value
validation. That immediately expands the scope from a "simple hack" to
something else.

It would take me 1-2 hours to rough that out if I punted on collections in a
JTable (because then you need to make a dynamic model to support the beans
in the collection, which is essentially the exact same problem using a
JTable instead of the JPanel -- plus I don't have a good dynamic JTable
working well yet).

But it is a good idea, and I may just write something like that.

Regards,

Will Hartung
(willh@msoft.com)


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.