private void putPlanetImageToButton() { planetImageIcon = new ImageIcon(fileURL); planetImage = planetImageIcon.getImage().getScaledInstance(65, 65, java.awt.Image.SCALE_SMOOTH); imageButton[buttonIndex] = new JButton(planet.planetName().toUpperCase(), new ImageIcon(planetImage)); imageButton[buttonIndex].addActionListener( PlanetActionListener.planetInformation(planet.toString()) .andMultipleFramesContainer(multipleFramesContainer)); }
private void setURL() { fileURL = this.getClass().getResource("images/" + planet.planetName() + ".png"); }