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: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Enter the netbeans any good beginner stuff?

 
0
  #1
Mar 15th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Enter the netbeans any good beginner stuff?

 
1
  #2
Mar 16th, 2008
  1. public void actionPerformed(ActionEvent e) {
  2. JFileChooser fileChooser = new JFileChooser(".");
  3. int status = fileChooser.showOpenDialog(screen);
  4. if (status == JFileChooser.APPROVE_OPTION) {
  5. dataFileName.setText(fileChooser.getSelectedFile().
  6. getAbsolutePath());
  7. }
  8. }

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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: Enter the netbeans any good beginner stuff?

 
0
  #3
Mar 18th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Enter the netbeans any good beginner stuff?

 
0
  #4
Mar 18th, 2008
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC