Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Is this possible ?

$
0
0
Why doesn't this sort of thing work ?


I created a method that takes one String, and that method will set a new path of an ImageIcon based on the parameter passed in. and then return it.

I had planned on using it as a neat little method to swap the players current image form different classes.
based on KeyEvents trigged, to reflect a player jumping, or walking and so forth.


private static String player_ii_path = "";

static ImageIcon player_ii = new ImageIcon(player_ii_path) ;
static Image player =  player_ii.getImage() ;

public static String set_new_player_ii_path(String p_new_player_ii_Path)
{
    player_ii_path = p_new_player_ii_Path ; 
    return player_ii_path ;
}



Thanks.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>