Frame frameLocal = (Frame)getComponent();
if (button == minimizeButton) {
frameLocal.setVisible(false);
} else if (button == maximizeButton) {
frameLocal.moveToFront();
frameLocal.setMaximized(!frameLocal.isMaximized());
} else if (button == closeButton) {
frameLocal.close();
}
}