diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 954b304..8d61649 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -20,6 +20,7 @@ import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -338,20 +339,30 @@ public class TestingList extends Panel { public void loadTests() throws FileNotFoundException, IOException{ Properties prop = new Properties(); String fileName = "../script/tests/devces/LS/.config"; - //InputStream is = new FileInputStream(fileName); - //this.jTextField1.setText(is.toString()); - //prop.load(is); -//Create a file chooser -final JFileChooser fc = new JFileChooser(); + InputStream fc = new FileInputStream(fileName); + this.jTextField1.setText(fc.toString()); + //prop.load(fc); + - -//In response to a button click: -int returnVal = fc.showOpenDialog(NetbeansPluginPanel.this); -this.jTextField1.setText(fc.toString()); + //addToTable(prop.getProperty("name"), prop.getProperty("description")); addToTable(("name"), ("description")); //System.out.println(prop.getProperty("tests")); } + + public void selectFile(){ + final JFileChooser fc = new JFileChooser(); + + int returnVal = fc.showOpenDialog(NetbeansPluginPanel.this); + + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + //This is where a real application would open the file. + System.out.println("Opening: " + file.getName() + "."); + } else { + System.out.println("Open command cancelled by user." ); + } } } +}