【发布时间】:2017-01-04 05:30:21
【问题描述】:
我有 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";
}
}
}
谁能知道如何把它带到前面。感谢您的帮助...
【问题讨论】:
-
确保指定 JOptionPane 的父级(而不是使用 null)。如果这没有帮助,请发布一个正确的SSCCE 来证明问题。
-
@camickr 如何将父类添加到我的 JOptionPane ?我会编辑我的问题。
-
@amor 将
...showMessageDialog(null,...该行更改为...showMessageDialog(frame,...或您的JFrame具有的任何名称 -
@Frakcool 现在在我的 JOptionPane 中添加 Jframe 后解决了。谢谢你的帮助..呵呵
标签: java swing joptionpane