短いコードがあります。ダイアログを破棄したいのですが、ユーザーがダイアログを閉じられるようにしたくありません。機能しません。助けてください。
import javax.swing.*;
public class Processing extends JOptionPane{
JDialog jd;
public Processing(){
super(null, JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE, null, new Object[]{});
Icon processPic = new ImageIcon("C:\\Users\\Judit\\Desktop\\Mesekocka3D"
+ "\\externals\\pics\\szamitas.gif");
setMessage(processPic);
jd = createDialog("Számítás");
jd.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
jd.setVisible(true);
jd.dispose();
}
}
これは私のコードが今どのように見えるかです、私はJoptionpaneの代わりにJdialogを使用します、私はウェブサイトに私の編集を受け入れさせるためにもっと多くの文字を書くべきですか?
import javax.swing.*;
public class Mifasz
{
private static class Processing extends JDialog{
public Processing(){
Icon processPic = new ImageIcon("C:\\Users\\Judit\\Desktop\\Mesekocka3D"
+ "\\externals\\pics\\szamitas.gif");
JLabel label = new JLabel(processPic);
add(label);
setTitle("Számítás");
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
setSize(400, 70);
setLocation(330, 300);
setModal(true);
setVisible(true);
dispose();
}
}
public static void main(String[] args)
{
Processing pc = new Processing();
}
}