btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
JLabel mes = new JLabel("Please wait .. initializing");
mes.setBounds(268, 249, 221, 14);
frame.getContentPane().add(mes);
JDialog d = new JDialog(frame, "Please wait .. initializing", true);
ImageIcon loading = new ImageIcon("ajax-loader.gif");
frame.add(new JLabel("loading... ", loading, JLabel.CENTER));
JDialog d = new JDialog(frame, "Please wait .. initializing", true);
d.setVisible(true);
d.setBounds(268, 249, 221, 14);
d.setLocationRelativeTo(frame);
d.setVisible(true);
}
}
未显示JLabel,但在addActionListener
上可以看到jdialog