Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


[java] Clicking on canvases... (canvii?)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Smoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 March 2000 - 03:11 PM

Hello again folks. Well I''m at it again with yet another problem. Basically what I have is a Panel with 4 canvases and 4 labels underneath each canvas (it''s to scroll through the tiles for a game editor). So what I want to do is when I click on a canvas, I want the label underneath it to go a different background color. Well it''s the clicking that''s the problem. Here''s what I tried: public boolean action (Event evt, Object arg) { String lbl = new String(); for (int x = 0; x < 4; x++) { if (evt.target == canvas[x]) lblObj[x].setBackground(Color.blue); else lblObj[x].setBackground(Color.lightGray); } return true; } Well needless to say this didn''t work. Does anyone have any other ideas/suggestions? I''d appreciate it. Thanks. Smoo BTW canvas[x] is another class that extends canvas

Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 March 2000 - 12:04 PM

I believe this is using the old event model in Java...I highly recommend changing to using an ActionListener and updating the label in actionPerformed.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS