I understand that it is with a cycle but I have been trying this and it does not come out, it leaves the window and the text area with the button but it does not come out what is in my file txt import javax.swing. ; import java.awt.event. ; import java.io.File; import java.io.FileReader; import java.io.BufferedReader;
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io. *; import java.awt.event.ActionListener;
public class See extends JFrame { // private Link link; private JButton consult; private JTextArea textArea; private JScrollPane scrollpane1;
public Consultar(){
super("Consulta");
setLayout(null);
textArea = new JTextArea();
scrollpane1=new JScrollPane(textArea);
scrollpane1.setBounds(40,40,300,200);
add(scrollpane1);
consultar = new JButton("Cosultar");
consultar.setBounds(40,260,100,30);
add(consultar);
}
public static void main(String args[]) {
File archivo;
try{
archivo = new File("/Users/mahlul/Desktop/Programa/ArchivoNuevo.txt");
if (archivo.createNewFile()){
System.out.println("");
}
}catch(Throwable e){
}
Consultar consultarl = new Consultar();
consultarl.setBounds(0,0,400,380);
consultarl.setVisible(true);
}
}