代码如下:
package 对话框1;import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;public class UseRightButton extends JFrame {
public static JPanel panel; public static UseRightButton urb; public static JDialog dialog; public UseRightButton() {
setTitle("弹出菜单");
setSize(400, 300);
panel = new JPanel(); } public static void main(String[] args) { dialog = new JDialog();
UseRightButton rb = new UseRightButton();
rb.setVisible(true); JOptionPane pane = new JOptionPane("通讯中... ...");
dialog = pane.createDialog(panel, null);
dialog.setUndecorated(true);
dialog.setAlwaysOnTop(true);
dialog.show();
}}
编辑后报错。 想实现这个功能dialog.setUndecorated(true);