简单Java仿windows记事本 下载本文

} } }

副程序:

else if (e.getActionCommand().equals(\全选\ jta.selectAll(); }

else if (e.getActionCommand().equals(\日期\ intpos=jta.getCaretPosition(); java.util.GregorianCalendar calendar=new java.util.GregorianCalendar(); java.util.Date date=calendar.getTime(); tempString=date.toString(); jta.insert(tempString, pos); }

importjava.awt.*; importjavax.swing.*;

publicclassHelpDialogextendsJDialog{ }

运行结果:

publicHelpDialog(Notepad f) { }

super(f,\,true);

Container content=getContentPane(); JLabel jl1=newJLabel(\); JLabel jl2=newJLabel(\作者:李佳乐\);

JLabel jl3=newJLabel(\:2606880162@qq.com\); content.setLayout(newGridLayout(3,1)); content.add(jl1); content.add(jl2); content.add(jl3);

setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setLocationRelativeTo(f); setSize(200, 100); setVisible(true);