5 Topics

Member Avatar for
Member Avatar for andruluchko

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 …

Member Avatar for mKorbel
0
1K
Member Avatar for sing1006

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 < …

Member Avatar for sing1006
0
795
Member Avatar for c.pentasuglia

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 …

Member Avatar for JamesCherrill
0
292
Member Avatar for 2concussions

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] …

Member Avatar for 2concussions
0
436
Member Avatar for Progr4mmer

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 …

Member Avatar for Progr4mmer
0
134

The End.