Total Java noob, I need to figure out how to capture string entered as an argument for one method in order to reuse it later. Basically, here I pass String content as a label when creating buttons:
public void start() {
// set up the label for one button
viewer.setButtonLabel(1, "");
viewer.setButtonLabel(2, "");
viewer.setButtonLabel(3, "");
// start the viewer
viewer.open();
}
Then I want to reuse the string I've given as the button label as the keywords for a search in the next method, taking into account which button was pressed:
public void buttonPressed(int n) {
// fetch an image of the Forum from Flickr
Photo photo = finder.find("", 5);
}
I feel I'm making this much harder than it has to be but I'm totally new to Java and can't seem to find what I'm looking for. Would really appreciate any tips you may have.