Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String everything = null;
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader("file.txt"));
- } catch (FileNotFoundException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- try {
- StringBuilder sb = new StringBuilder();
- String line = null;
- try {
- line = br.readLine();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- while (line != null) {
- sb.append(line);
- sb.append('\n');
- line = br.readLine();
- }
- everything = sb.toString();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } finally {
- try {
- br.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- help.setText("Segítség");
- help.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent arg0) {
- JOptionPane.showMessageDialog( null, everything,"Valami",JOptionPane.OK_CANCEL_OPTION);
- //JOptionPane.showInputDialog(null, everything, "asd", JOptionPane.OK_CANCEL_OPTION);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement