導航:首頁 > 編程語言 > java記賬本

java記賬本

發布時間:2023-01-15 08:41:15

Ⅰ 求人幫忙完成安卓大作業,開發一個記賬本或記事本的小程序,要有具體步驟解釋的,,誰能幫幫我,一點都不

package tuxingjiemian;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.io.PrintStream;
public class jishiben extends JFrame {
JPanel jp=new JPanel();
JFrame find_replace=new JFrame();
JMenu file=new JMenu("文件");
JMenu edit=new JMenu("編輯");
JMenu help=new JMenu("幫助");
JMenuBar menubar=new JMenuBar();
JTextArea aa=new JTextArea();
class Open implements ActionListener {
public void actionPerformed(ActionEvent e) {
JFileChooser jf= new JFileChooser();
jf.showOpenDialog(jishiben.this);
try {
PrintStream p=new PrintStream(jf.getSelectedFile().getPath());
} catch (Exception e2) {
}
}
}
class Save implements ActionListener {
public void actionPerformed(ActionEvent e) {
JFileChooser jf= new JFileChooser();
jf.showSaveDialog(jishiben.this);
try {
PrintStream p=new PrintStream(jf.getSelectedFile().getPath());
} catch (Exception e2) {
}
}
}
public jishiben(){
this.setTitle("記事本");
this.setSize(500, 500);
this.setLayout(new BorderLayout());
JMenuItem open=new JMenuItem("打開");
open.addActionListener(new Open());
JMenuItem save=new JMenuItem("保存");
save.addActionListener(new Save());
JMenuItem exit=new JMenuItem("退出");
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);

}
});
file.add(open);
file.add(save);
file.addSeparator();
file.add(exit);
menubar.add(file);
this.add(new JScrollPane(aa),BorderLayout.CENTER);
JMenuItem =new JMenuItem("復制");
JMenuItem past=new JMenuItem("粘貼");
JMenuItem delete=new JMenuItem("刪除");
JMenuItem find=new JMenuItem("查找");
JMenuItem replace=new JMenuItem("替換");
.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
jishiben.this.aa.();
}
});
past.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
jishiben.this.aa.paste();
}
});

delete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jishiben.this.aa.replaceSelection(null);
}
});
edit.add();
edit.add(past);
edit.add(delete);
edit.add(find);
edit.add(replace);
menubar.add(edit);
help.add(new JMenuItem("幫助"));
menubar.add(help);
this.add(menubar,BorderLayout.NORTH);
this.setVisible(true);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
}

public static void main(String[] args) {
new jishiben();
}
};

閱讀全文

與java記賬本相關的資料

熱點內容
若有以下程序void 瀏覽:432
大數據主體有哪些 瀏覽:961
如何學習編程的優點 瀏覽:906
最新版本手機qq 瀏覽:463
簡述在word 瀏覽:528
qq怎麼清楚歷史記錄防止被盜 瀏覽:263
發送手機里的錄音文件在哪裡 瀏覽:866
js獲取下一個兄弟元素 瀏覽:293
js模板引擎原理 瀏覽:72
linuxo文件運行 瀏覽:713
什麼免費備份數據 瀏覽:342
測量大師導入底圖找不到文件 瀏覽:313
小紅傘安裝程序要求版本6 瀏覽:799
全民k歌pcm文件夾 瀏覽:224
c圖片寫入資料庫 瀏覽:466
c串口程序 瀏覽:500
中農金融注冊app有哪些 瀏覽:629
回收站文件清理不在電腦上有痕跡 瀏覽:886
dx版本更新 瀏覽:738
主機集群教程 瀏覽:939

友情鏈接