aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Returning a value from a Netbeans / SWING application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Returning a value from a Netbeans / SWING application" Watch "Returning a value from a Netbeans / SWING application" New topic
Author

Returning a value from a Netbeans / SWING application

Allen Leggett
Greenhorn

Joined: Jun 26, 2009
Posts: 3
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 someone could ask you “Good Folks” down on the javaranch 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 ‘static’ 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: MyClass project contains MyClassApp.java and MyClassView.java
Normally, MyClassApp.java “launches” itself and then in startup() it does a show(new MyClassView(this)). I have several “look up” 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 ( MyApplicationApp and MyApplicationView) and I want to “call” MyClassApp…to search a database and return a key value to MyApplicationView…..

My "Menu Program" just does and execCMD() to run the Classes in my application.
For "CALLING MyClassApp from MyApplicationView" I believe I should use a constructor and create an instance of MyClassApp but what method do I use to “retrieve the key” from the class.
Can I just “Launch” the MyClassView? From MyClassApp

I read, “Using the Swing Application Framework(JSR296)” and I’m still not clear on how to do this…
I’m thinking that when MyClassApp completes the EXIT() it will cause a shutdown of the JVM (And kill MyApplicationView).

I could include the functionality in MyApplicationView but this program is already HUGE!

So I’ve a bunch of questions.
1) How do I accomplish this? (please)
2) Is this 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

Thanking you in advance,

Current Java Newbie / Future Java CSD and Java Heavyweight,

Allen Leggett
I still don't understand everything I know- Yogi Berra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Returning a value from a Netbeans / SWING application