public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { p5.add(mortgage); Slot pobject; pobject = Game.SlotsList[x.getProperties().get(propertydisplay.getSelectedIndex())]; if (pobject instanceof Property) { ((Property) (pobject)).monopolizeProperty(); pr1.setText("Buy Price:" + pobject.getBuyPrice()); pr2.setText("Rent Price:" + pobject.getRentPrice()); pr3.setText("House Price:" + pobject.getHousePrice()); pr4.setText("Hotel Price:" + pobject.getHotelPrice()); pr5.setText("Mortgaged:" + pobject.getMortgage()); } else if (pobject instanceof Railroad) { pobject.adjustRentPrice(); pr1.setText("Buy Price:" + pobject.getBuyPrice()); pr2.setText("Rent Price:" + pobject.getRentPrice()); pr3.setText(""); pr4.setText(""); pr5.setText(""); } else { pobject.adjustDiceFactor(); pr1.setText("Buy Price:" + pobject.getBuyPrice()); pr2.setText("Dice Factor:" + pobject.getDiceFactor()); pr3.setText(""); pr4.setText(""); pr5.setText(""); } } }