import javax.swing.JPanel;
import javax.swing.JLabel;

public class ItemStatus extends JPanel{
	JLabel item_1, item_2, item_3;
	UserTank ut;
	
	public ItemStatus(UserTank ut){
		this.ut = ut;
		item_1 = new JLabel("Item 1: none  ");
		item_2 = new JLabel("Item 2: none  ");
		item_3 = new JLabel("Item 3: none  ");
		
		add(item_1);
		add(item_2);
		add(item_3);
	}
	public void update(){
		if(ut.getItem(0)!=null){
			item_1.setText("Item 1: "+ut.getItem(0).name);
		}else{
			item_1.setText("Item 1: none  ");
		}
		if(ut.getItem(1)!=null){
			item_2.setText("Item 2: "+ut.getItem(1).name);
		}else{
			item_2.setText("Item 2: none  ");
		}
		if(ut.getItem(2)!=null){
			item_3.setText("Item 3: "+ut.getItem(2).name);
		}else{
			item_3.setText("Item 3: none  ");
		}
	}
}