Wednesday, December 8, 2010

generateButtons

private void generateButtons(){
circle.setBounds(buttonWidth, screenHeight, buttonHeight, buttonHeight);
circle.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
setInputImage("/Users/kyla/Desktop/circle_jpg.jpg");
}
});
square.setBounds(buttonWidth*2, screenHeight, buttonWidth, buttonHeight);
square.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
setInputImage("/Users/kyla/Desktop/anothercircle.jpg");
}
});
triangle.setBounds(buttonWidth*3, screenHeight, buttonWidth, buttonHeight);
triangle.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
setInputImage("/Users/kyla/Desktop/shapes.jpg");
}
});
add(circle);
add(square);
add(triangle);
}


Part 2  <--- Back to Part 2

No comments:

Post a Comment