show.java

来自「在java环境下开发的一个笔记记录及管理工具」· Java 代码 · 共 50 行

JAVA
50
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package stageexperiment;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JTextArea;/** * * @author lina */ public class Show extends JFrame {     JTextArea t=new JTextArea();    JButton Jb=new JButton("确定");    public Show(final Main m) throws Exception    {           this.setLayout(null);        this.add(t);        this.add(Jb);        t.setBounds(0,0,600,400);        Jb.setBounds(0,400,600,100);        t.setMaximumSize(t.getPreferredSize());        //JScrollPane scrollPane=new JScrollPane(t);     	this.setBounds(40,20,600,500);    	this.setTitle("浏览");    	this.setVisible(true);        String s;        s="笔记文件名"+'\t'+"作者"+'\t'+"题目"+'\t'+"关键词"+'\t'+"备注"+'\t'+"路径"+'\r'+'\n';        for(int i=0;i<m.allnotes.getLength();i++)        {            s=s+m.allnotes.all[i].filename+'\t'+m.allnotes.all[i].writer+'\t'+m.allnotes.all[i].topic+'\t'+m.allnotes.all[i].keyword+'\t'+m.allnotes.all[i].remark+'\t'+m.allnotes.all[i].path+'\n';        }       t.setText(s);       Jb.addActionListener(new ActionListener()     {public void actionPerformed(ActionEvent e)       {     setVisible(false);       }    });   }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?