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
2 answers

Java Program Error: Cannot Find Symbol File

I am writing a code in java to display text file in JTextArea. Can Anyone tell me what is wrong with this code. It is saying cannnot find symbol file.. FOpen.addActionListener(new ActionListener() { public void…
Belal Khan
  • 2,099
  • 2
  • 22
  • 32
-2
votes
1 answer

Connecting botton frontend with listener in backend (the addActionListener

UPDATED: I think the issue might be that I have not added the: addActionListener(this) to the button, but the reason is because it was dragged and dropped. Had I done the GUI declaration everything would have been made in order, yet, I dont know how…
-2
votes
1 answer

Data output stream not working

import java.io.*; import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.util.*; public class two extends JFrame implements ActionListener { JLabel l1,l2; JTextArea a1,a2; JButton b1; JMenuBar bar; JMenu…
-2
votes
1 answer

How to solve this run time exception?

How to solve run time exception of this code ? when click button file chooser and add file from it the panel color Disappear (wrong thing happen in panel) This is my code: import javax.swing.JPanel; import javax.swing.JButton; import…
Yaser Har
  • 149
  • 1
  • 2
  • 11
-2
votes
2 answers

building a panel in which choose where save file

I would build a panel which let me choose where I can save a file. I read java documentation and I saw that there is a swing component named file chooser but I don't know how use it.what i want to do is choose the path in my machine where saved a…
Mazzy
  • 13,354
  • 43
  • 126
  • 207
-2
votes
2 answers

Something wrong with the program. How to rectify it?

The below program is used to take the input of integers from a text file and plot a XY graph.I have used JFileChooser to select the file. I'm trying to get the complete path of the file. I have created an ActionListener method for the button. When I…
User1234
  • 43
  • 1
  • 6
-3
votes
2 answers

How to read a Image file selected by user using JFileChooser

I want to read the image selected by user using JFileChooser and then be able to get the color Channels(R,G,B) and the width and height of the image. Is this the right approach to read the selected image file. File im1 = new…
Deepak kumar Jha
  • 524
  • 5
  • 16
-4
votes
1 answer

Java - How to save a .txt file where you want

I want the String text to be saved as a .txt file wherever I want. I think you can do that by using JFileChooser. Anyway here is my Code: class TextEditorFrame extends JFrame { JFileChooser chooser; public TextEditorFrame(){ …
fihdi
  • 145
  • 1
  • 1
  • 12
-4
votes
2 answers

Using JFileChooser? Java

So I need to open a java file to read through it and check if the number of parentheses are even (as much ( as )). This gives me an error saying no instance of OpenFile is in the scope. I copied this code, so I have no idea whats wrong with it. I…
trosy
  • 93
  • 3
  • 7
-4
votes
1 answer

Count occurrences of all 256 characters (GUI/Arrays)

I need help tweaking my code. I need to write a program that outputs the count of individual ascii characters in a txt file that the user uploads, but I'm having a lot of problems trying to get the array that I count into the GUI portion of the…
-4
votes
2 answers

what is wrong with my JFileChooser program

I am trying to write a program that copies one file and copies it's contents to another. I have to have user chose the files. i am stuck can some one please help me. import java.io.IOException; import java.nio.file.CopyOption; import…
-5
votes
1 answer

Difference Between showOpenDialog() and showSaveDialog()?

I would like to know the difference between showOpenDialog() and showSaveDialog() methods in the JFileChooser. What I found is the change in the title and the text of the approve button. Nothing seemed to be a difference. They can be set by using…
JavaTechnical
  • 8,846
  • 8
  • 61
  • 97
1 2 3
77
78