5 Topics
|
|
Hello, I try to rename file or directory using JFileChooser() and JButton(). But it gives me a NullPointer exeption. I have FileChooser, Button and TextField where I write new name for my file or directory. Can you say where I go wrong and how to solve this problem. // button … |
|
JMenuItem mntmLoad = new JMenuItem("Load"); mntmLoad.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(true); int option = chooser.showOpenDialog(testgui.this); if (option == JFileChooser.APPROVE_OPTION) { File[] sf = chooser.getSelectedFiles(); String filelist = "nothing"; if (sf.length > 0) filelist = sf[0].getName(); for (int i = 1; i < … |
|
Basically i'm wondering if i can fill the "File Name" field of a JFileChooser automatically. I'm pulling files from another machine using sftp, and specifying the file to be created with the JFileChooser. So that the file i'm transfering will be saved with the name and location i specify. As … |
|
hello. i am trying to make a text editor. i can't figure out how to get the file that i select in the JFileChooser to show in the JTextArea. and I also can't figure out how to get the text from the JTextArea to save into a .txt file. [code=java] … |
|
In my program when i close the save file chooser it opens another one ??? heres the code [CODE] import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.awt.*; import java.awt.event.*; import java.io.*; public class JB extends JPanel implements ActionListener{ protected JTextArea textArea; public JB() { setLayout(new BorderLayout()); JTextArea textArea = new JTextArea(); textArea.setFont(new … |
The End.