如何编写一个便签程序(用Java语言编写)

热度:336   发布时间:2011-02-18 11:44:16

如何编写一个便签程序(用Java语言编写)

因为以前没有好好学习Java,都搞忘了,请大家原谅,也请你们指导一下,怎么编写这个程序,再次谢谢各位了!

搜索更多相关的解决方案:

Java

----------------解决方案--------------------------------------------------------

什么是便签啊?

----------------解决方案--------------------------------------------------------

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

/*

* NewOkCancelDialog.java

*

* Created on 2011-2-21, 13:41:25

*/

/**

*

* @author Administrator

*/

public class NewOkCancelDialog extends javax.swing.JDialog {

/** A return status code - returned if Cancel button has been pressed */

public static final int RET_CANCEL = 0;

/** A return status code - returned if OK button has been pressed */

public static final int RET_OK = 1;

/** Creates new form NewOkCancelDialog */

public NewOkCancelDialog(java.awt.Frame parent, boolean modal) {

super(parent, modal);

initComponents();

}

/** @return the return status of this dialog - one of RET_OK or RET_CANCEL */

public int getReturnStatus() {

return returnStatus;

}

/** This method is called from within the constructor to

* initialize the form.

* WARNING: Do NOT modify this code. The content of this method is

* always regenerated by the Form Editor.

*/

//

private void initComponents() {

jScrollBar1 = new javax.swing.JScrollBar();

jDesktopPane1 = new javax.swing.JDesktopPane();

okButton = new javax.swing.JButton();

cancelButton = new javax.swing.JButton();

jScrollPane1 = new javax.swing.JScrollPane();

jTextArea1 = new javax.swing.JTextArea();

jScrollBar1.setBackground(new java.awt.Color(255, 255, 102));

addWindowListener(new java.awt.event.WindowAdapter() {

public void windowClosing(java.awt.event.WindowEvent evt) {

closeDialog(evt);

}

});

okButton.setText("OK");

okButton.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

okButtonActionPerformed(evt);

}

});

cancelButton.setText("Cancel");

cancelButton.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

cancelButtonActionPerformed(evt);

}

});

jTextArea1.setBackground(new java.awt.Color(255, 255, 51));

jTextArea1.setColumns(20);

jTextArea1.setRows(5);

jScrollPane1.setViewportView(jTextArea1);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(28, 28, 28)

.addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18)

.addComponent(cancelButton)

.addGap(32, 32, 32))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap())

);

layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, okButton});

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(cancelButton)

.addComponent(okButton))

.addContainerGap())

);

pack();

}//

private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {

doClose(RET_OK);

}

private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {

doClose(RET_CANCEL);

}

/** Closes the dialog */

private void closeDialog(java.awt.event.WindowEvent evt) {

doClose(RET_CANCEL);

}

private void doClose(int retStatus) {

returnStatus = retStatus;

setVisible(false);

dispose();

}

/**

* @param args the command line arguments

*/

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

NewOkCancelDialog dialog = new NewOkCancelDialog(new javax.swing.JFrame(), true);

dialog.addWindowListener(new java.awt.event.WindowAdapter() {

public void windowClosing(java.awt.event.WindowEvent e) {

System.exit(0);

}

});

dialog.setVisible(true);

}

});

}

// Variables declaration - do not modify

private javax.swing.JButton cancelButton;

private javax.swing.JDesktopPane jDesktopPane1;

private javax.swing.JScrollBar jScrollBar1;

private javax.swing.JScrollPane jScrollPane1;

private javax.swing.JTextArea jTextArea1;

private javax.swing.JButton okButton;

// End of variables declaration

private int returnStatus = RET_CANCEL;

}

我已经把模板编好了,但是咋个把它编译成适用的便签纸呢?

----------------解决方案--------------------------------------------------------

呵呵

----------------解决方案--------------------------------------------------------

java写便签_如何编写一个便签程序(用Java语言编写)相关推荐

  1. C语言编写一个四位数的和,c语言编写一段程序,输入一个四位数,输出各位数字的和...

    用C语言编写程序,输入一个正整数n(1 #include"stdio.h"intmain(){\x09inti,j,n;\x09inta[12];\x09intmin,mx;\x0 ...

  2. java编写一个个人通信录程序

    Java编写一个个人通信录程序,具有如下功能: (1)定义一个类,包括姓名.邮政编码.通信地址等成员变量 (2)查找:根据姓名在文件中查找个人信息,如果找到则显示出来 (3)添加:向文件中写个人信息 ...

  3. 用JAVA写一个画图小程序(JAVA 大作业)

    第一次写博客 且是稍微大点的程序 看看就行 重新写的在这,更加清晰明了:点击进入:用JAVA写一个画图小程序(JAVA 大作业)重排版本 设计思路 首先我直接去了Windows自带画图程序去实践模拟, ...

  4. java编写一个圆环类Ring_编写一个圆环类ring的java程序

    <编写一个圆环类ring的java程序>由会员分享,可在线阅读,更多相关<编写一个圆环类ring的java程序(1页珍藏版)>请在金锄头文库上搜索. 1.编写一个圆环类 Rin ...

  5. C语言编程编制职工档案管理程序,C语言 编写一个职工档案程序.doc

    C语言 编写一个职工档案程序 一.实验项目: 实验6 课程设计 (时间安排:6课时) 二.实验内容: 编写一个职工档案程序,设计实现如下功能: 建立一个职工数据结构,结构包含姓名.序号.性别和年龄信息 ...

  6. matlab编写正整数阶乘函数,用matlab语言编写程序:编写一个计算阶乘的函数,再编写一个脚本文件,通过键盘输入计算阶乘的n值....

    点击查看用matlab语言编写程序:编写一个计算阶乘的函数,再编写一个脚本文件,通过键盘输入计算阶乘的n值.具体信息 答:编写一个matlab文件,求1到n的阶乘之和.其代码编写的目的,就是学会自定义 ...

  7. 2023-05-29 用 fltk gui库编写一个打字练习程序

    用 fltk gui库编写一个打字练习程序 前言 一.FLTK GUI 库 二.使用步骤 1.引入库 2.使用代码 总结 前言 给孩子练习键盘打字, 发现终端还是欠点意思, 研究了一下gui, 最终用 ...

  8. 华为面试题:请编写一个字符串压缩程序,将字符串中连续出席的重复字母进行压缩,并输出压缩后的字符串。

    已经很久没有写博客了,2017年的最后一天写一篇,用这样的方式和2017年告别挺好的.这段时间经历找工作,是我这一年截止到目前最迷茫的时期.看看程序,思考能让我冷静下来,不被杂事打扰,前天看到了华为的 ...

  9. 利用C#编写一个水准测量近似平差程序

    一.代码界面展示 整个界面主要就是就整个界面而言,其实主要使用到的控件就是Menu,tabControl,dataGridView,richtextbox. 二.代码运算结果展示 1.导入数据 这里就 ...

最新文章

  1. linux命令查看几位,Linux每周几个命令(一)--查找篇
  2. MongoDB与c#(二)简单例子 使用1.7版本驱动
  3. C# WebBrowser 设置代理
  4. asp删除mysql_asp php 清空access mysql mssql数据库的代码
  5. iOS屏幕旋转 浅析
  6. 15 PP配置-生产计划-主数据-定义特殊采购类型
  7. 我如何使用Python查找有趣的人来关注Medium
  8. 如何明晰定位与责任_公司股权决定公司决策,如何设计合理公司股权架构?
  9. android 字体px转sp,Android中px,dp,sp区别及换算
  10. 面向对象(OOP)五大基本原则
  11. 安装PaddleOCR遇到ERROR: Command errored out with exit status 1:command: ‘f:\python3.7\python.exe‘ -u -c
  12. [转载] 算法导论:分治法,python实现合并排序MERGE-SORT
  13. Linux下解压.war文件
  14. acs880变频器选型手册_设备安装:变频器调试成功就差这一步了
  15. 详解clientHeight、offsetHeight、scrollHeight、offsetTop、scrollTop
  16. 硕士论文查重原理与快速通过的七大方法(转载)
  17. excel按某个值进行筛选后,将筛选出来的行进行排序
  18. OKR最新模板推荐,生产研发团队如何使用OKR工具?
  19. js 移动端 下载 doc文件
  20. android卡通头像,Face V(卡通头像制作)

热门文章

  1. MySQL 开启远程访问权限 | 宝塔系统
  2. meta标签的用处详解
  3. 用C++调用tensorflow在python下训练好的模型(centos7)
  4. 病毒的手工排除与分析(更新完毕)
  5. 部署环境_Hyperledger Fabric Composer环境部署(一)
  6. es springboot 不设置id_springboot整合ES_文档ID删除
  7. c语言算ex自定义函数,用C语言写定积分的通用函数:sin(x),cos(x),eX.
  8. 里bl2和bl3为什么分开_英国的水池为什么有两个水龙头?为什么英国有独立的冷热水龙头?...
  9. 2016 linux发行版排行_选择困难症必看!云服务器如何选择操作系统,Windows和Linux哪个更好?...
  10. python的ogr模块_python GDAL/OGR模块安装注意事项