Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1.  public class NewJFrame extends javax.swing.JFrame {
  2.  
  3.    ArrayList<Integer> colours = new ArrayList<Integer>();
  4.    BufferedReader br = null;
  5. /**
  6.  * Creates new form NewJFrame
  7.  */
  8. public NewJFrame() {
  9.     int word=0;
  10.  
  11.     try {
  12.         br = new BufferedReader(new FileReader("Booklist.txt"));
  13.  
  14.         while ((word == br.read())){
  15.             colours.add(word);
  16.         }
  17.     } catch (IOException e) {
  18.         e.printStackTrace();
  19.     } finally {
  20.         try {
  21.             br.close();
  22.         } catch (IOException ex) {
  23.             ex.printStackTrace();
  24.         }
  25.     }
  26.  
  27.     initComponents();
  28. }
  29.  
  30. static public Boolean linearSearch(ArrayList colours, String B) {
  31.     for (int k = 0; k < A.length; k++) {
  32.         if (A[k].equals(B)) {
  33.             return true;
  34.         }
  35.     }
  36.     return false;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement