Hi everyone. Some background on myself. Former AS/400 guy, recently downsized and unemployed. Taking this opportunity to learn java. I’m fairly new to Java and Netbeans. Since I’m unemployed and not in an organization with ‘experts’, I’m trying to find resources for help. I’m in ATLanta so I’ve joined www.ajug.org in hopes of networking with folks to find resources. I’ve also applied for some 'Obama Bucks' in order to take some classes. Until then I was hoping to ask you "Good Folks" for some help!
I’ve developed the security structure and a dynamic menu for a SWING application that uses MySQL. I’ve developed lots of SWING apps and compiled the classes that perform TABLE maintenance (Insert/Update/Delete) on the TABLES my application will use. NOW, I’m getting into the ‘nitty-gritty’ of the application. I’m continuing to stumble over ‘pretty simple stuff’ that I believe a ‘SWING Application Architect’ or one of you Netbeans/SWING experts could readily answer.
Concerning Netbeans and Returning a value from a SWING class.
Netbeans creates two or more .java files in my projects.
Example: desktopapplication project contains
- DesktopApplicationApp.java and
- DesktopApplicationView.java
Normally, DesktopApplicationApp.java launches() itself and then in startup() it does a show(new DesktopApplicationView(this)).
I have several "look up" TABLES tables and want to create separate classes that allow the user to search through the TABLE a return a row.
(This is OOP, right!?)
So if I have an application (DesktopApplicationApp and DesktopApplicationView) and I want use another CLASS SelectValueApp to search a database and return a key value to DesktopApplicationView.
My "Menu Program" just does an execCMD() to run the Classes in my application.
For "CALLING" SelectValueApp from DesktopApplicationView I know I should use a constructor and create an instance of SelectValueApp .... but what method do I use to "retrieve the key" from the class?
Can I just Launch() the SelectValueView from DesktopApplicationView? I read, "Using the Swing Application Framework(JSR296)" and I’m still not clear on how to do this. I’m thinking that when SelectValueApp completes the EXIT() it will cause a shutdown of the JVM (And kill DesktopApplicationView).
I could include the functionality of SelectValueView in DesktopApplicationView but this program is already HUGE!
So I’ve a bunch of questions.
1) How do I accomplish this? (please). Also, I’ve referenced these posts and they are "very Close" to what I need to know.
questions/1091389/how-to-transfer-objects-from-jframe-to-another-jframe
questions/573317/java-swing-close-window-without-exiting-app
questions/573378/managing-parent-frame-from-child-frame-on-java-swing
2) Is it a limitation of "SingleFrameApplication"? (Trying to open another frame to return the value) 3) Do I have to put all the functionality in the MyApplicationView? 4) Or does the code that Netbeans generates just make this tough and there is a simple, elegant way to accomplish this?
ALSO, I’ll create a Short, Self Contained, Correct (Compilable), Example (SSCCE) and update this post
Thanking you in advance,
Current Java Newbie / Future Java CSD and Java Heavyweight,