Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Show image from...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15860 of 16566
Post > Topic >>

Show image from comboBox selected

by taingaukwai@[EMAIL PROTECTED] Mar 6, 2008 at 02:01 AM

I want to show a card image in label of a panel.  I try to create
three array:
                 public String[][] CardStrings
		       = {{ "as", "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s",
"ts", "js", "qs", "ks" },
		          { "ah", "2h", "3h", "4h", "5h", "6h", "7h", "8h", "9h",
"th", "jh", "qh", "kh" },
		          { "ac", "2c", "3c", "4c", "5c", "6c", "7c", "8c", "9c",
"tc", "jc", "qc", "kc" },
		          { "ad", "2d", "3d", "4d", "5d", "6d", "7d", "8d", "9d",
"td", "jd", "qd", "kd" }};
	public String [] strSuit = {"Spades", "Hearts", "Diamonds", "Clubs"};
	public String [] strNum = {"Ace", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "Jack", "Queen", "King"};

Then, one JcomboBox1 load strSuit[] & another one JcomboBox2 load
strNum[], it record its index and so I use Actionlistener to hear
e.getSource() any change.  For example, I choose (Hearts, 2) that may
comboBox1.getSelectedIndex(1) & comboBox2.getSelctedIndex(1).  The
question is how to combine 2 index to point string "2h" that load my
card image from img folder
 




 1 Posts in Topic:
Show image from comboBox selected
taingaukwai@[EMAIL PROTEC  2008-03-06 02:01:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:32:10 CST 2008.