LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-30-2009, 11:00 AM   #1
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Libraries for reflection-based GUI in Java


Hi,

can anyone recommend any decent GUI-building libraries for Java which are based on the reflection API? I believe JavaBeans is partly based on this idea, but it seems that you have to use the rather impoverished-looking NetBeans tool if you're going to use JavaBeans. I'm looking for something which doesn't tie me to a particular IDE or other tool.

Googling for "java gui reflection" brings up surprisingly little of interest. I've started writing my own library, it's a little tricky to get the details right, but it seems like it'll be very useful once it's done, so I find it hard to believe there isn't somebody out there who's already done a better job.

Thanks,

OS
 
Old 10-30-2009, 01:07 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Sorry -

I have no idea if you're looking for "GUI-building tools for Java", GUI-based tools that use "Java reflection" (perhaps analogous to .Net Reflector?), an IDE for Java (of which, frankly, I like NetBeans. But perhaps you might prefer Eclipse?) or something else entirely.

Just FYI, "Java Beans" have nothing to do directly with Netbeans (or Eclipse or building Java programs with notepad and a command line), and Java "GUIs" have nothing directly to do with "Java reflection".

'Hope that helps .. at least a little bit.

Last edited by paulsm4; 10-30-2009 at 01:08 PM.
 
Old 10-31-2009, 10:16 AM   #3
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by paulsm4 View Post
I have no idea if you're looking for "GUI-building tools for Java", GUI-based tools that use "Java reflection" (perhaps analogous to .Net Reflector?), an IDE for Java (of which, frankly, I like NetBeans. But perhaps you might prefer Eclipse?) or something else entirely.
None of those is quite what I'm looking for, sorry if I wasn't clear! What I'm looking for is a Java method which takes an object as a parameter and, provided the object's class definition follows appropriate naming conventions etc, returns a GUI component which can be used to edit the object.

I'm thinking, for example, that for any pair of getXXX / setXXX methods in the object's class definition, the returned component would have a subcomponent for editing the corresponding field: a checkbox for boolean fields, perhaps a slider or spinner for numbers within a fixed range, a textfield for field types which can easily be represented as text (numbers, dates, file paths, etc). The subcomponent would have an event listener which called the corresponding setXXX method.

Probably it's only possible to build a fairly simple GUI this way, but I'm not too concerned about it looking super-pretty. The programs I write at home tend to be small and I don't want to spend lots of time writing GUI boilerplate. I find even writing a small panel with only a few components takes more time and code than it should for something so simple, and it puts me off writing GUIs entirely. Sometimes it's nice to have one though!

At work we have a somewhat similar system to what I just described, but what it actually does is to generate source code for both the object to be edited and the GUI component, so you end up with a separate class for each GUI component instead of just creating the component dynamically. This seems fairly inefficient when you can perfectly well examine an object's methods at runtime.


As for IDEs, I'm a fan of Eclipse, having just started using it a few months ago. But I certainly don't want to insult any NetBeans users! I've never actually seen it, I've just heard vague complaints about it from a few other people, and some screenshots I saw of it looked a little dry. Sun's own JavaBeans tutorial mentions NetBeans fairly early on, so I thought the two were related (well, that and the name pointed to that conclusion).

It does seem as though some JavaBeans concepts are pretty close to the dynamic gui-creation I described above, but it's still not clear to me whether there is any way to take a Jave "Bean" and dynamically create a GUI editor component for it, independent of the NetBeans GUI builder and without generating source code.

Hope that makes things a bit clearer!

OS
 
Old 03-03-2015, 11:01 AM   #4
olitank
LQ Newbie
 
Registered: Mar 2015
Posts: 1

Rep: Reputation: Disabled
Hello,

You may want to try ReflectionUI.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GUI based package-manager installation on console based linux kevinchkin Linux - Software 2 07-14-2009 12:25 AM
Open Source GUI Libraries halfbrazilian Programming 13 10-25-2008 09:47 PM
LXer: Eclipse GUI-based online help system for Java LXer Syndicated Linux News 0 04-21-2008 10:50 PM
LXer: Validate Pre-Existing Java GUI-based apps with RAVEN LXer Syndicated Linux News 0 02-13-2006 07:46 PM
from a gui-based s/w to a web-based app h/w Programming 0 04-13-2004 02:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration