| | |
Enter the netbeans any good beginner stuff?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Solved Threads: 6
Hi all,
I am fairly new to java, as well as netbeans, but I come from a VB background.
I am wanting to build platform independant aps and find the need to cross over into this world of Java, and netbeans (so far) is the best visual ide I have seen for it.
I am having a few issues finding tutorials on using netbeans for GUI aps.
Perhaps I am missing something in concept, I don't know. VB lets you create and call windows at will, pretty much.
Here's what I have.
the main window when starting a project has a button and a textfield.
I have created a second (swing) window which is called InputLocation
when I created InputLocation it showed InputLocation.java in the project area.
InputLocation is a swing "file chooser" dialogue in reality.
When the button is pushed on the main form, I need a couple of things to happen.
1.) the InputLocation dialogue should appear.
2.) once the user chooses the location, this dialogue should go away and the location chosen should appear in the main page textfield that I have created.
I am using this for later manipulation of files which reside in this folder (and it's subfolders)
I can't seem to figure out what to put in the mouse event area of the source to even get the InputLocation dialogue to appear.
Anyone able to help me with this, or show me where I can find the information that I need?
Thanks in advance
Sage
I am fairly new to java, as well as netbeans, but I come from a VB background.
I am wanting to build platform independant aps and find the need to cross over into this world of Java, and netbeans (so far) is the best visual ide I have seen for it.
I am having a few issues finding tutorials on using netbeans for GUI aps.
Perhaps I am missing something in concept, I don't know. VB lets you create and call windows at will, pretty much.
Here's what I have.
the main window when starting a project has a button and a textfield.
I have created a second (swing) window which is called InputLocation
when I created InputLocation it showed InputLocation.java in the project area.
InputLocation is a swing "file chooser" dialogue in reality.
When the button is pushed on the main form, I need a couple of things to happen.
1.) the InputLocation dialogue should appear.
2.) once the user chooses the location, this dialogue should go away and the location chosen should appear in the main page textfield that I have created.
I am using this for later manipulation of files which reside in this folder (and it's subfolders)
I can't seem to figure out what to put in the mouse event area of the source to even get the InputLocation dialogue to appear.
Anyone able to help me with this, or show me where I can find the information that I need?
Thanks in advance
Sage
Java Syntax (Toggle Plain Text)
public void actionPerformed(ActionEvent e) { JFileChooser fileChooser = new JFileChooser("."); int status = fileChooser.showOpenDialog(screen); if (status == JFileChooser.APPROVE_OPTION) { dataFileName.setText(fileChooser.getSelectedFile(). getAbsolutePath()); } }
Something like this.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Solved Threads: 6
Great answer, you were right, it was "something like this". I only had to plug in the right names (I may have missnamed them in my explination), and poof, I had the popup.
There were a couple of minor tweeks to make it fit my exact setup, but I did give you fairly limited information and no code sample.
Points to your reputation for putting me on the right track.
Thanks a bunch for your help.
Sage
There were a couple of minor tweeks to make it fit my exact setup, but I did give you fairly limited information and no code sample.
Points to your reputation for putting me on the right track.
Thanks a bunch for your help.
Sage
you didn't use wrong names, just different ones from the ones I chose in the application I pulled that code from 
It's pretty much boilerplate code, you'll be writing similar methods a LOT.

It's pretty much boilerplate code, you'll be writing similar methods a LOT.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Other Threads in the Java Forum
- Previous Thread: StringTokenizer problem
- Next Thread: problem in for each
| Thread Tools | Search this Thread |
actuate android api applet application applications array arrays automation balls bank binary bluetooth business chat class classes clear client code codesnippet collections component database defaultmethod development dice dragging ebook eclipse error event exception formatingtextintooltipjava fractal froglogic game givemetehcodez graphics gui hql html ide image infinite input integer intersect invokingapacheantprogrammatically j2me java javaprojects jni jpanel julia linux list loop looping map method methods mobile mysql netbeans newbie numbers openjavafx parameter php print problem program programming project recursion repositories scanner screen scrollbar server set size sms sort sorting sql sqlserver state storm string sun superclass swing swt text-file threads time tree windows






