public PanelProgramObject(RoomObject obj, final IMainPanel i) {
		this.obj = obj;
		JScrollPane panel = new JScrollPane();

		panelGrid = new JPanel();
		panel.setViewportView(panelGrid);
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[] { 0, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0 };
		gridBagLayout.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
		gridBagLayout.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
		panelGrid.setLayout(gridBagLayout);
		
		JLabel lblLabel = new JLabel("Label:");
		lblLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		txtLabel = new JTextField(obj.getLabel());
		txtLabel.setBackground(SystemColor.info);
		txtLabel.setEditable(false);
		txtLabel.setColumns(10);
		
		txtType = new JTextField(obj.toString());
		txtType.setEditable(false);
		txtType.setColumns(10);
		txtType.setBackground(SystemColor.info);
		
		JLabel lblType = new JLabel("Type:");
		lblType.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		txtManOn = new JTextField(obj.getManualOn() + "");
		txtManOn.setEditable(false);
		txtManOn.setColumns(10);
		txtManOn.setBackground(SystemColor.info);
		
		txtManOff = new JTextField(obj.getManualOff() + "");
		txtManOff.setEditable(false);
		txtManOff.setColumns(10);
		txtManOff.setBackground(SystemColor.info);
		
		JLabel lblMaOn = new JLabel("Man ON:");
		lblMaOn.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblManOff = new JLabel("Man OFF:");
		lblManOff.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JToolBar toolBar = new JToolBar();
		toolBar.setFloatable(false);
		
		JLabel lblActive = new JLabel("Active");
		lblActive.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblPrio = new JLabel("Prio");
		lblPrio.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblCondition = new JLabel("Condition 1");
		lblCondition.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblCondition_2 = new JLabel("Condition 2");
		lblCondition_2.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblCondition_1 = new JLabel("Condition 3");
		lblCondition_1.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblBetween = new JLabel("Between");
		lblBetween.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblTtl = new JLabel("TTL");
		lblTtl.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblAction = new JLabel("Action");
		lblAction.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addComponent(panel, GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(10)
							.addComponent(lblActive)
							.addGap(18)
							.addComponent(lblPrio, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE)
							.addGap(26)
							.addComponent(lblCondition, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
							.addGap(15)
							.addComponent(lblCondition_2, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(lblCondition_1, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
							.addGap(48)
							.addComponent(lblBetween, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
							.addGap(120)
							.addComponent(lblTtl, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE)
							.addGap(10)
							.addComponent(lblAction, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(txtLabel, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblLabel))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(txtType, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblType, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
								.addComponent(lblMaOn, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(txtManOn, GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addGroup(groupLayout.createSequentialGroup()
									.addComponent(txtManOff, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(toolBar, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE))
								.addComponent(lblManOff, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))))
					.addGap(48))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
						.addGroup(groupLayout.createSequentialGroup()
							.addContainerGap()
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblLabel)
								.addComponent(lblType)
								.addComponent(lblMaOn)
								.addComponent(lblManOff))
							.addGap(10)
							.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
								.addComponent(txtLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManOn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManOff, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addGroup(groupLayout.createSequentialGroup()
							.addContainerGap(30, Short.MAX_VALUE)
							.addComponent(toolBar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addGap(15)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblActive)
						.addComponent(lblPrio)
						.addComponent(lblCondition)
						.addComponent(lblCondition_1)
						.addComponent(lblCondition_2)
						.addComponent(lblBetween)
						.addComponent(lblTtl)
						.addComponent(lblAction))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(panel, GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
		);
		
		JButton btnAdd = new JButton("Add Job");
		btnAdd.setVisible(false);
		btnAdd.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				addActionPane(null);
			}
		});
		btnAdd.setIcon(IconUtils.getIcon("add"));
		toolBar.add(btnAdd);
		
		JButton btnSave = new JButton("Save");
		btnSave.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				i.onClose();
				save();
			}
		});
		btnSave.setIcon(IconUtils.getIcon("save"));
		toolBar.add(btnSave);
		
		JButton btnCancel = new JButton("Cancel");
		btnCancel.setIcon(IconUtils.getIcon("remove"));
		toolBar.add(btnCancel);
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				i.onClose();
			}
		});
		setLayout(groupLayout);

		for (RoomJob job : obj.getJobs()) {
			addActionPane(job);
		}
		
		update();
		
		if (panelGrid.getComponents().length == 0) {
			for (int s = 0; s < 15; s++) {
				addActionPane(null);
			}
		}
	}