用Java编写的记事本程序 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-20
flowLayout1=new FlowLayout(); FindDlg(Frame frame,String title, boolean modal){ super(frame,title,modal); this.setTitle("查找"); this.setSize(200,90); this.setModal(true); findText.setText(" 查找内容 "); findText.setSize(70,60); strText.setText(" "); strText.setSize(130,60); btnNext.setText("向下查找"); btnNext.setSize(100,40); btnNext.addActionListener(new btnNext_actionAdapter(this)); btnUp.setText("向上查找"); btnUp.setSize(100,40); btnUp.addActionListener(new btnUp_actionAdapter(this)); this.getContentPane().setLayout(flowLayout1); this.getContentPane().add(this.findText,flowLayout1); this.getContentPane().add(this.strText,flowLayout1); this.getContentPane().add(this.btnNext,flowLayout1); this.getContentPane().add(this.btnUp,flowLayout1); } FindDlg(){ this(null,"",false); } public void btnNext_actionPerformed(ActionEvent e){ this.findstr=this.strText.getText(); this.flag=true; this.dispose(); } public void btnUp_actionPerformed(ActionEvent e){ this.findstr=this.strText.getText(); this.flag=false; this.dispose(); } public String getFindStr(){ return this.findstr; } public boolean getFlag(){ return this.flag; } } class btnNext_actionAdapter implements java.awt.event.ActionListener{ FindDlg adaptee; btnNext_actionAdapter(FindDlg adaptee){ this.adaptee=adaptee; } public void actionPerformed(ActionEvent e){ adaptee.btnNext_actionPerformed(e); } } class btnUp_actionAdapter implements java.awt.event.ActionListener{ FindDlg adaptee; btnUp_actionAdapter(FindDlg adaptee){ this.adaptee=adaptee; } public void actionPerformed(ActionEvent e){ adaptee.btnUp_actionPerformed(e); } } /****************************************************** *----------------------------------------------------- * FontSet.java * jeason * 04-12-23 2:19 *----------------------------------------------------- *****************************************************/ package jeason; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FontSet extends JDialog{ //JPanel panel1 = new JPanel(); private String font1=""; JLabel txtStr=new JLabel("请选择字体"); JLabel txt2=new JLabel("请选择字型"); List list1 = new List(3,false); List list2 = new List(3,false); JButton btnOk=new JButton("确定"); JButton btnNo=new JButton("撤销"); FlowLayout flowLayout1=new FlowLayout(); boolean flag=true; int type; FontSet(Frame frame,String title,boolean modal){ this.setTitle("字体设置"); this.setSize(200,230); this.setModal(true); txtStr.setSize(100,60); list1.setSize(100,60); list1.setMultipleMode(false); this.txt2.setSize(100,60); list2.setSize(100,60); btnOk.setMnemonic(´Y´); btnOk.setSize(100,20); btnOk.addActionListener(new btnOk_actionAdapter(this)); //btnNo.setText("取消(N)"); btnNo.setMnemonic(´N´); btnNo.setSize(100,20); btnNo.addActionListener(new btnNo_actionAdapter(this)); ///////////// Font //////////////////////////// |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于用Java编写的记事本程序 - 编程入门网的所有评论