miAbout.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { About.getAbout.setVisible(true); } }); --------------------------------- public class About extends javax.swing.JDialog { private static About ab; public static About getAbout() { if(ab==null) ab=new About(new javax.swing.JFrame(), true); return ab; }
/** Creates new form About */ public About(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } ........... }
public void actionPerformed(ActionEvent e) {
About.getAbout.setVisible(true);
}
});
---------------------------------
public class About extends javax.swing.JDialog { private static About ab;
public static About getAbout()
{
if(ab==null)
ab=new About(new javax.swing.JFrame(), true);
return ab;
}
/** Creates new form About */
public About(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
...........
}
dialog.setContentPane(new AboutPanel());
class AboutPanel extends JPanel{
public AboutPanel(){
...//里面就放关于你自己产品的介绍,通常就是几个Label,麻烦点了可能会有表格,看情况了
}
}