GUI button assistance - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

GUI button assistance

tonjastonjas Posts: 1Member
[b][red]This message was edited by tonjas at 2005-6-26 10:40:19[/red][/b][hr]
I am attempting to construct a jeopardy program.
Difficulty arises when trying to have one button variable respond to every button click event. (The layout of the scores/questions are established in a method where new buttons are placed in changing coordinates)
i.e,
if (buttonObj == valueButton)
{
messageBox(etc.......

GBFrame is currently the frame of reference.
Any help would be super-duper!



Comments

  • moomoo Posts: 147Member
    >> I am attempting to construct a jeopardy program.
    >> Difficulty arises when trying to have one button variable respond to
    >> every button click event. (The layout of the scores/questions are
    >> established in a method where new buttons are placed in changing
    >> coordinates)
    ...

    Hi,
    i'm not quite sure what you mean. are you trying to have one button to handle different events and react to them context sesitive ? to make it clear: buttonA does a repaint or sums up a players score depending on the context it is used. is that what you want to do ?
    if so you might just attach some kind of state to your button which changes in context or you might change the action command. another solution might be to create a button for each action and replace them in a panel given to the context.


Sign In or Register to comment.