在其他 windows 的顶部显示 JOptionPane(带下拉菜单)

Show JOptionPane (with dropdown menu) on the top of other windows

我正在开发一个程序,它在启动时会显示以下 menu (menu_image)。我有一个小问题:我想把它显示在另一个 windows 的顶部,但我无法做到这一点。

class Menu {
    public String showMenu(){
        Object[] options = {"option1", "option2", "option3"};
        Object selectionObject = JOptionPane.showInputDialog(null, "Choose", "Menu", JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
        String selectionString = selectionObject.toString();
        return selectionString;
    }
}

有人可以帮帮我吗?提前谢谢你

根据Berger的建议,我通过以下方式解决了我的问题...

class Menu {
    public String showMenu(){
        //i solved my problem adding the following 2 lines of code...
        JFrame frame = new JFrame();
        frame.setAlwaysOnTop(true);

        Object[] options = {"option1", "option2", "option3"};
        //...and passing `frame` instead of `null` as first parameter
        Object selectionObject = JOptionPane.showInputDialog(frame, "Choose", "Menu", JOptionPane.PLAIN_MESSAGE, null, options, options[0]);
        String selectionString = selectionObject.toString();
        return selectionString;
    }
}