#does anyone know how to pass the output from actionListener into a local variable?

6 messages · Page 1 of 1 (latest)

graceful tundra
#
              spin.setOpaque(false);
              spin.setContentAreaFilled(false);
              spin.setBorderPainted(false);
              spin.setBounds(WIDTH-150,HEIGHT/3,100,100); 
              spin.addActionListener(e -> Action.getSpin());

and i dont know how to get the output from the actionListener in the last line into a local variable

gaunt citrusBOT
#

This post has been reserved for your question.

Hey @graceful tundra! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

royal garnet
#

step 1: get it as a non-local variable
step 2: if you really must, make a local variable that takes its value from the non-local variable that was made above

graceful tundra
#

thing is I think i need the data in a local variable to work with as its linked with a button press

royal garnet
#

Pretty sure you don't, but don't hesitate to do the two steps then