public SimpleFrame() {
		setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
		setTitle("Forest:");
		setLocation(400, 200);
		Container con = getContentPane();
		con.setLayout(new FlowLayout());
		button1 = new JButton("Create");
		button2 = new JButton("Read");
		button3 = new JButton("Update");
		button4 = new JButton("Delete");
		textArea = new JTextArea();
		con.add(button1);
		con.add(button2);
		con.add(button3);
		con.add(button4);
		con.add(textArea);
		ArrayList<Oak> list1 = new ArrayList<Oak>();
		ArrayList<DescriptionOak> list2 = new ArrayList<DescriptionOak>();
		button1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				Oak object1 = new Oak();
				DescriptionOak object2 = new DescriptionOak();
				object1 = Oak.createOak();
				object2 = DescriptionOak.createOak(object1.getIdOak());
				list1.add(object1);
				list2.add(object2);
				try {
					DatabaseHelper object3 = new DatabaseHelper();
					object3.insertOakDescriptionOak(
							object3.getPreparedStatement(),
							list1.get((list1.size() - 1)),
							list2.get(list2.size() - 1));
				} catch (SQLException r) {
				}

			}

		});
		button2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				// list1.removeAll(list1);
				// list2.removeAll(list2);
				try {
					DatabaseHelper object3 = new DatabaseHelper();
					if (list1.isEmpty() == true) {
						object3.selectOak(list1);
						object3.selectDescriptionOak(list2);
					}
				} catch (SQLException r) {
				}
				textArea.setText(null);
				for (int i = 0; i < list1.size(); i++) {
					textArea.append(" Id of Oak = " + list1.get(i).getIdOak()
							+ " ");
					textArea.append(" Height of tree = "
							+ list1.get(i).getHeightTree() + " ");
					textArea.append(" Shape of lists of tree "
							+ list1.get(i).getShapeListsTree() + " ");
					textArea.append(" Age of tree= "
							+ list1.get(i).getAgeTree() + " ");
					textArea.append(" Number of Acorns = "
							+ list1.get(i).getNumberAcorns() + " ");
					textArea.append(" Number of branches = "
							+ list1.get(i).getNumberBranches() + "\n");
					// }
					// for(int i=0;i<list2.size();i++)
					// {
					textArea.append(" Id of description = "
							+ list2.get(i).getIdDescription() + " ");
					textArea.append(" Id of Oak = " + list2.get(i).getIdOak()
							+ " ");
					textArea.append(" Type of Oak " + list2.get(i).getTypeOak()
							+ " ");
					textArea.append(" Size of acorn = "
							+ list2.get(i).getSizeAcorn() + "\n");

				}

			}

		});
		button3.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				try {
					// DatabaseHelper object3 = new DatabaseHelper();
					list1.removeAll(list1);
					list2.removeAll(list2);
					{
						DatabaseHelper object3 = new DatabaseHelper();
						object3.selectOak(list1);
						object3.selectDescriptionOak(list2);
					}
					// object3.deleteOakDescriptionOak(object3.getPreparedStatement());
					// for (int i=0;i<list1.size();i++)
					// {
					// object3.insertOakDescriptionOak(object3.getPreparedStatement(),list1.get(i),list2.get(i));
					// object3.selectOak(list1);
					// object3.selectDescriptionOak(list2);
					// }
				} catch (SQLException r) {
				}

			}

		});
		button4.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				Scanner scan = new Scanner(System.in);
				System.out.println("Input index to delete");
				int index = scan.nextInt();
				list1.remove(index);
				list2.remove(index);
				try {
					DatabaseHelper object3 = new DatabaseHelper();
					object3.deleteOakDescriptionOak(object3
							.getPreparedStatement());
					for (int i = 0; i < list1.size(); i++) {
						object3.insertOakDescriptionOak(
								object3.getPreparedStatement(),
								list1.get((list1.size() - 1)),
								list2.get(list2.size() - 1));
					}
				} catch (SQLException r) {
				}

			}

		});
	}