Page 172 - MDP2022-3
P. 172
RestartButton.setIcon(resultTabRestartEnteredImage);
RestartButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
Music buttonEnteredMusic = new
Music("buttonPressedMusic.mp3" , false);
buttonEnteredMusic.start();
}
@Override
public void mouseExited(MouseEvent e) {
RestartButton.setIcon(resultTabRestartBasicImage);
RestartButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
@Override
public void mousePressed(MouseEvent e) {
Music buttonEnteredMusic = new
Music("buttonPressedMusic.mp3" , false);
buttonEnteredMusic.start();
//게임제시작이벤트
restart();
}
});
add(RestartButton);
RankButton.setVisible(false);
RankButton.setBounds(900, 430, 320, 250);
RankButton.setBorderPainted(false);
RankButton.setContentAreaFilled(false);
RankButton.setFocusPainted(false);
RankButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
RankButton.setIcon(resultTabRankEnteredImage);
RankButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
Music buttonEnteredMusic = new
Music("buttonPressedMusic.mp3" , false);
buttonEnteredMusic.start();
}
@Override
public void mouseExited(MouseEvent e) {
RankButton.setIcon(resultTabRankBasicImage);
RankButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
@Override
public void mousePressed(MouseEvent e) {
Music buttonEnteredMusic = new