Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String spelregels = "";
- try {
- URL url = getClass().getResource("/DATA/Spelregels.txt");
- FileReader reader = new FileReader(new File(url.toURI()));
- BufferedReader br = new BufferedReader(reader);
- StringBuilder sb = new StringBuilder();
- String line = br.readLine();
- while (line != null) {
- sb.append(line);
- sb.append(System.lineSeparator());
- line = br.readLine();
- }
- spelregels = sb.toString();
- } catch (FileNotFoundException e1) {
- e1.printStackTrace();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- JFrame SpelregelsFrame = new JFrame("Spelregels");
- JPanel paneel = new JPanel(new BorderLayout());
- JTextArea area = new JTextArea(spelregels);
- paneel.add(area, BorderLayout.CENTER);
- SpelregelsFrame.add(paneel, BorderLayout.CENTER);
- SpelregelsFrame.setResizable(false);
- SpelregelsFrame.setVisible(true);
- SpelregelsFrame.requestFocus();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement