	   import java.io.*;
	   import java.util.*;
	   import javax.swing.*;
       import javax.swing.table.*;
       import java.awt.*;

public class readfromfile2
{
	
	
public static void main(String args[]) throws IOException
{	
  String s1="a.txt";
  JFileChooser fc=new JFileChooser();
  ExampleFileFilter filter = new ExampleFileFilter();
  filter.addExtension("txt");
  filter.setDescription("text file : .txt");
  fc.setFileFilter(filter);
  if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {File file = fc.getSelectedFile();s1=file.getName(); }
  File f=new File(s1);
BufferedReader fin=new BufferedReader(new FileReader(f));
double number=Double.parseDouble(fin.readLine());
String s="number = "+number;
JOptionPane.showMessageDialog(null,s,"sequential file reading",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
