1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-13 12:55:00 -05:00

make sure that the popup window displays above the task bar

This commit is contained in:
Reinhard Pointner 2019-04-30 19:25:09 +07:00
parent 38d9af01fe
commit c9876e093e

View File

@ -1,8 +1,12 @@
package net.filebot.util.ui;
import static javax.swing.SwingUtilities.*;
import static net.filebot.Logging.*;
import static net.filebot.ui.ThemeSupport.*;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import javax.swing.Action;
import javax.swing.Icon;
@ -48,6 +52,18 @@ public class ActionPopup extends JPopupMenu {
setLightWeightPopupEnabled(false);
}
@Override
public void show(Component invoker, int x, int y) {
super.show(invoker, x, y);
// make sure that the popup window displays above the task bar
try {
getWindowAncestor(this).setAlwaysOnTop(true);
} catch (Exception e) {
debug.log(Level.WARNING, e, e::getMessage);
}
}
protected JLabel createLabel(String text) {
JLabel label = new JLabel(text);
label.setForeground(getForeground());