gpt4 book ai didi

java - 设置 JOptionPane.showMessageDialog 显示前面

转载 作者:太空宇宙 更新时间:2023-11-04 12:17:49 25 4
gpt4 key购买 nike

我有 Joption,但它显示在浏览器后面

public class LoginInterceptor extends AbstractInterceptor {

private static final long serialVersionUID = 1L;
private static final Logger LOG = Logger.getLogger(LoginInterceptor.class);

@Override
public String intercept(ActionInvocation invocation) throws Exception {

Map<String, Object> session = invocation.getInvocationContext().getSession();

if (session != null && session.get("idUser") != null) {
LOG.warn("session not expired");
LOG.info("");
return invocation.invoke();
} else {
LOG.warn("session expired");

//this`s my joption dialog
javax.swing.JOptionPane.showMessageDialog(null, "Session Expired");
return "login";
}
}
}

任何人都可以知道如何将其放在前面。感谢您的帮助...

最佳答案

我添加了这个,现在解决了

        JFrame frame = new JFrame();            
javax.swing.JOptionPane.showMessageDialog(frame,"Session Expired");

关于java - 设置 JOptionPane.showMessageDialog 显示前面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39184983/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com