mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fixed ClassCastException for Client windows
This commit is contained in:
parent
d055c5e804
commit
375cc311b9
1 changed files with 15 additions and 13 deletions
|
@ -415,19 +415,21 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
MagePaneMenuItem menuItem;
|
||||
|
||||
for (int i = 0; i < windows.length; i++) {
|
||||
MagePane window = (MagePane) windows[i];
|
||||
if (window.isVisible()) {
|
||||
menuItem = new MagePaneMenuItem(window);
|
||||
menuItem.setState(i == 0);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
MagePane frame = ((MagePaneMenuItem) ae.getSource()).getFrame();
|
||||
setActive(frame);
|
||||
}
|
||||
});
|
||||
menuItem.setIcon(window.getFrameIcon());
|
||||
menu.add(menuItem);
|
||||
if (windows[i] instanceof MagePane) {
|
||||
MagePane window = (MagePane) windows[i];
|
||||
if (window.isVisible()) {
|
||||
menuItem = new MagePaneMenuItem(window);
|
||||
menuItem.setState(i == 0);
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
MagePane frame = ((MagePaneMenuItem) ae.getSource()).getFrame();
|
||||
setActive(frame);
|
||||
}
|
||||
});
|
||||
menuItem.setIcon(window.getFrameIcon());
|
||||
menu.add(menuItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue