how should my could code be positioned in netbean
In my test project I have code that reads and writes to a textfile. I have created a new gui project with a inputbox for the file name and a submit button. In the test project i have a fileRead and a fileWrite, how do I add this to my new gui project? I mean how do I get the code to instantiate? Ba开发者_如何学Csically i want to merge my test code to my gui. Both were develop on netbeans.
Not sure I fully understand the question but try setting up an ActionListener for the button.
In the NetBeans GUI editor, try right-clicking on the button then choosing Events > Action > actionPerformed. This will take you to the source code and allow you to write the necessary code to call when the button is pressed (e.g. code to read from your text file).
This NetBeans tutorial might be helpful in walking you through the required steps
精彩评论