private void setMatrix1Panel() {
		int rows = Integer.parseInt(matrix1Rows.getText());
		int columns = Integer.parseInt(matrix1Columns.getText());
		if ((rows == 1 && columns == 1) || rows < 1 || rows > 10 || columns < 1 || columns > 10){
			matrix1Rows.setText(matrix1R + "");
			matrix1Columns.setText((input1.length / matrix1R) + "");
			throw new IllegalArgumentException();
		}
		
		JPanel p1 = new JPanel();
		input1 = new JTextField[rows * columns];
		for (int i = 0; i < input1.length; i++){
			input1[i] = new JTextField(3);
			input1[i].setHorizontalAlignment(SwingConstants.CENTER);
			input1[i].getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "calculate");
			input1[i].getActionMap().put("calculate", new AbstractAction(){

				public void actionPerformed(ActionEvent e) {
					calculate();
				}
				
			});
			p1.add(input1[i]);
		}
		p1.setLayout(new GridLayout(rows, columns, 3, 3));
		
		JPanel p2 = new JPanel();
		p2.setBorder(BorderFactory.createMatteBorder(0, 2, 0, 2, Color.BLACK));
		p2.add(p1);
		
		JPanel p3 = new JPanel();
		p3.add(p2);
		
		JPanel p4 = new JPanel();
		p4.add(new JLabel("Size  = "));
		p4.add(matrix1Rows);
		p4.add(new JLabel(" x "));
		p4.add(matrix1Columns);
		
		space = (int) ((p4.getPreferredSize().getWidth() - p3.getPreferredSize().getWidth()) / 2);
		
		matrix1R = rows;
		matrix1Panel.removeAll();
		matrix1Panel.setLayout(new BorderLayout());
		matrix1Panel.add(p4, BorderLayout.NORTH);
		matrix1Panel.add(p3, BorderLayout.CENTER);
	}