日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > java >内容正文

java

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

發布時間:2023/11/30 java 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java写便签_如何编写一个便签程序(用Java语言编写) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

如何編寫一個便簽程序(用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语言编写)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。