Questions tagged [jfilechooser]

JFileChooser is a Java Swing component to provide a simple mechanism for the user to choose a file.

JFileChooser is a Java Swing component to provide a simple mechanism for the user to choose a file. For information about using JFileChooser, see How to Use File Choosers, a section in The Java Tutorial.

1167 questions
-2
votes
1 answer

JFileChooser with additional JCheckBox for setting the file opening method

I am using JFileChooser as a component for selecting files in this code. I need one additional input from the user to trigger the way how the file shall be opened. In my use case if it shall be read to the RAM entirely or not. I know I can ask user…
VojtaK
  • 483
  • 4
  • 13
-2
votes
1 answer

Cannot change size of JFrame using setSize or setPreferredSize

I have been looking into the JFileChooser of Java. I used Oracles FileChooserDemo as a base template. I have made some slight modifications to Oracles demo. My problem is, when I run the program, the JFrame is really small. Even if I use setSize or…
DemonSlayer730
  • 19
  • 1
  • 1
  • 4
-2
votes
1 answer

how to use JFileChooser to open a file by just wiring the file name

I can't open a file by just writing the file's name in the JFileChooser unless I'm in the same folder as it, what can I do to fix it? JDialog.setDefaultLookAndFeelDecorated(true); if (chooser.showOpenDialog(null) ==…
J. Doe
  • 1
  • 1
-2
votes
1 answer

JFileChooser setCurrent directory to Homegroup or Network

I want that when my dialog is opened, then directly go to Homegroup. Thanks. JFileChooser fc = null; try { fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setCurrentDirectory(new File(new…
-2
votes
1 answer

Saving a current open file using JFileChooser

Hi I am having trouble saving currently open files with JFileChooser. I understand how to save a new file using showSaveDialog but I want to open a file in JFileChooser, edit it and save it to the existing file I have opened instead of it opening a…
-2
votes
1 answer

JFileChooser does not work in Java, NetBeans

I'll summarize and sorry for my English. I have a client and a server thread, when touching a button send file is correctly displayed the JFileChooser with showOpenDialog, when want to create a second JFileChooser in the server thread when a file is…
mndv
  • 130
  • 8
-2
votes
1 answer

File[] array to imageicon java

I am using a JFilehooser to load multiple images to a File[]. I then want to load the File[] to multiple ImageIcons. For example: if (returnValue == JFileChooser.APPROVE_OPTION) { File[] files = fileChooser.getSelectedFiles(); ImageIcon…
user6300287
-2
votes
1 answer

JFileChooser to allow the user to select the input file of credit card numbers

Here, I did with the user input test credit card number, but now I want to do this things with uses JFileChooser to allow the user to select the input file of credit card numbers and Display the results in an output file. I got As output file with…
preay
  • 19
  • 1
  • 4
-2
votes
2 answers

File/FileInputStream issue

Having a problem with this code have been at it for quite a bit and have looked and played with it on multiple different occasions and angels and can't seem to get it going its not accepting the File underlined in red (Code Below) This belongs to…
TravJav92
  • 117
  • 1
  • 2
  • 10
-2
votes
1 answer

Reusable JFileChooser for updating image

I am trying to create a function which can preview the image that the user selected from a customized JFileChooser. The following are the code snippets from the test frame and the customized JFileChooser. Test.java public class Test extends JFrame…
UnBroKeN
  • 25
  • 2
  • 11
-2
votes
1 answer

Filename as a String given from JFileChooser wont work

In my application I want to zip a file or folder from a given userinput. When I try to get the input from a JDialog, thats working fine but if I want to try to let the user choose from a fileChooser, my programm wont work - its always creating an…
BrainWorx
  • 103
  • 1
  • 13
-2
votes
1 answer

If we open a file, not opened again when user opens same file

I opened a file using JFileChooser. If I opened a file it is opened for first time and if I open the same file for second time it is also opened in new tab. I want to open a file for one time only. Here is my code, final JFileChooser jc = new…
lavanya
  • 1
  • 1
-2
votes
1 answer

How do I assign JFileChooser to a JButton in Netbeans?

I'd prefer it from Property editor -> Customize Code. I need to select a folder in one instance and a file in another. The function will be: On pressing jButton1, jFileChooser1 opens and on confirmation of selection, returns the folder/file path…
-2
votes
1 answer

Load and read a zip file with JFileChooser?

I have developed a program where I want to save different files to a zip as backup and then load them back when a restore button is clicked. I have the save file code below but how would I load this file with JFileChooser? I don't need to read it to…
eoinDub
  • 81
  • 2
  • 4
  • 10
-2
votes
2 answers

How to use FileChooser in Java?

I need help using the FileChooser. Here's what I'm trying to do: I need to show the Open Dialog Box if the "JMenuItem open" is clicked and the Save Dialog Box if "JMenuItem save" is clicked. I'm still a newbie so go easy on me :) This is just a…
gauche23
  • 67
  • 1
  • 4
1 2 3
77
78