/*
* NoteFrame.java
*
* Created on 2008年9月19日, 下午5:27
*/
/**
*
* @author fyx
*/
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.*;
import java.io.*;
public class NoteFrame extends javax.swing.JFrame {
/** Creates new form NoteFrame */
int num;//标签判断
String path=null;
public NoteFrame() {
Toolkit tool=getToolkit();
Dimension screen=tool.getScreenSize();
setLocation(screen.width-425,0);
setVisible(true);
initComponents();
Open("note1",b1);
Open("note2",b2);
Open("note3",b3);
Open("note4",b4);
Open("note5",b5);
Open("note6",b6);
Open("note7",b7);
Open("note8",b8);
Open("note9",b9);
Open("note10",b10);
Open("note11",b11);
Open("note12",b12);
Open("note13",b13);
Open("note14",b14);
Open("note15",b15);
}
public void ShowDialog()//查看标签对话框显示位置
{
Toolkit tool=getToolkit();
Dimension screen=tool.getScreenSize();
jd.setLocation(screen.width-425,0);
jd.setVisible(true);
}
public void Open(String openpath,JButton b)
{
try
{
Reader in = new FileReader(openpath);
BufferedReader br=new BufferedReader(in);
String ot=null;String opent="";
while((ot=br.readLine())!=null)
{
opent=opent+ot+"/n";
}
b.setText(opent);
}
catch(IOException io)
{
System.err.println("IOException: " + io.getMessage());
}
}
public void save()
{
String t=jta.getText();
FileOutputStream fstrm = null;
BufferedOutputStream ostrm = null;
try
{
fstrm = new FileOutputStream(path);
ostrm = new BufferedOutputStream(fstrm);
byte[] bytes = null;
try
{
bytes =t.getBytes();
ostrm.write(bytes);
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
catch(IOException io)
{
System.err.println("IOException: " + io.getMessage());
}
finally
{
try
{
ostrm.flush();
fstrm.close();
ostrm.close();
}
catch(IOException ioe)
{
System.err.println("IOException: " + ioe.getMessage());
}
}
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jd = new javax.swing.JDialog();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jta = new javax.swing.JTextArea();
Delet = new javax.swing.JButton();
Save = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
b1 = new javax.swing.JButton();
b2 = new javax.swing.JButton();
b3 = new javax.swing.JButton();
b4 = new javax.swing.JButton();
b5 = new javax.swing.JButton();
b6 = new javax.swing.JButton();
b7 = new javax.swing.JButton();
b8 = new javax.swing.JButton();
b9 = new javax.swing.JButton();
b10 = new javax.swing.JButton();
b11 = new javax.swing.JButton();
b12 = new javax.swing.JButton();
b13 = new javax.swing.JButton();
b14 = new javax.swing.JButton();
b15 = new javax.swing.JButton();
jd.setTitle("标签内容查看");
jd.setBackground(new java.awt.Color(255, 255, 204));
jd.setMinimumSize(new java.awt.Dimension(424, 407));
jd.setModal(true);
jd.setResizable(false);
jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 204)));
jPanel2.setForeground(new java.awt.Color(255, 255, 204));
jPanel2.setMinimumSize(new java.awt.Dimension(424, 407));
jta.setBackground(new java.awt.Color(255, 255, 204));
jta.setColumns(20);
jta.setFont(new java.awt.Font("文鼎PL中楷Uni", 0, 18)); // NOI18N
jta.setLineWrap(true);
jta.setRows(5);
jta.setWrapStyleWord(true);
jta.setMinimumSize(new java.awt.Dimension(50, 23));
jScrollPane1.setViewportView(jta);
Delet.setText("删除");
Delet.setFocusable(false);
Delet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DeletActionPerformed(evt);
}
});
Save.setText("保存");
Save.setFocusable(false);
Save.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SaveActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(83, 83, 83)
.addComponent(Save, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Delet, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(68, 68, 68))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
.addContainerGap()))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(332, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(Delet)
.addComponent(Save))
.addGap(50, 50, 50))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(94, Short.MAX_VALUE)))
);
javax.swing.GroupLayout jdLayout = new javax.swing.GroupLayout(jd.getContentPane());
jd.getContentPane().setLayout(jdLayout);
jdLayout.setHorizontalGroup(
jdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 407, Short.MAX_VALUE)
);
jdLayout.setVerticalGroup(
jdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("标签列表");
setBackground(new java.awt.Color(255, 255, 204));
setResizable(false);
jPanel1.setBackground(new java.awt.Color(255, 255, 204));
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 204)));
jPanel1.setForeground(new java.awt.Color(255, 255, 204));
jPanel1.setMaximumSize(new java.awt.Dimension(425, 400));
jPanel1.setMinimumSize(new java.awt.Dimension(425, 400));
jPanel1.setOpaque(false);
jPanel1.setPreferredSize(new java.awt.Dimension(425, 400));
jPanel1.setRequestFocusEnabled(false);
b1.setBackground(new java.awt.Color(255, 255, 204));
b1.setFont(new java.awt.Font("宋体", 0, 18));
b1.setFocusable(false);
b1.setHideActionText(true);
b1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b1.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
b1.setPreferredSize(new java.awt.Dimension(40, 25));
b1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b1ActionPerformed(evt);
}
});
b2.setBackground(new java.awt.Color(255, 255, 204));
b2.setFont(new java.awt.Font("宋体", 0, 18));
b2.setFocusable(false);
b2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b2.setPreferredSize(new java.awt.Dimension(41, 25));
b2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b2ActionPerformed(evt);
}
});
b3.setBackground(new java.awt.Color(255, 255, 204));
b3.setFont(new java.awt.Font("宋体", 0, 18));
b3.setFocusable(false);
b3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b3.setInheritsPopupMenu(true);
b3.setPreferredSize(new java.awt.Dimension(41, 25));
b3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b3ActionPerformed(evt);
}
});
b4.setBackground(new java.awt.Color(255, 255, 204));
b4.setFont(new java.awt.Font("宋体", 0, 18));
b4.setFocusable(false);
b4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b4.setPreferredSize(new java.awt.Dimension(41, 25));
b4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b4ActionPerformed(evt);
}
});
b5.setBackground(new java.awt.Color(255, 255, 204));
b5.setFont(new java.awt.Font("宋体", 0, 18));
b5.setFocusable(false);
b5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b5.setPreferredSize(new java.awt.Dimension(41, 25));
b5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b5ActionPerformed(evt);
}
});
b6.setBackground(new java.awt.Color(255, 255, 204));
b6.setFont(new java.awt.Font("宋体", 0, 18));
b6.setFocusable(false);
b6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b6.setPreferredSize(new java.awt.Dimension(41, 25));
b6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b6ActionPerformed(evt);
}
});
b7.setBackground(new java.awt.Color(255, 255, 204));
b7.setFont(new java.awt.Font("宋体", 0, 18));
b7.setFocusable(false);
b7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b7.setPreferredSize(new java.awt.Dimension(41, 25));
b7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b7ActionPerformed(evt);
}
});
b8.setBackground(new java.awt.Color(255, 255, 204));
b8.setFont(new java.awt.Font("宋体", 0, 18));
b8.setFocusable(false);
b8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b8.setPreferredSize(new java.awt.Dimension(41, 25));
b8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b8ActionPerformed(evt);
}
});
b9.setBackground(new java.awt.Color(255, 255, 204));
b9.setFont(new java.awt.Font("宋体", 0, 18));
b9.setFocusable(false);
b9.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b9.setPreferredSize(new java.awt.Dimension(41, 25));
b9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b9ActionPerformed(evt);
}
});
b10.setBackground(new java.awt.Color(255, 255, 204));
b10.setFont(new java.awt.Font("宋体", 0, 18));
b10.setFocusable(false);
b10.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b10.setPreferredSize(new java.awt.Dimension(41, 25));
b10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b10ActionPerformed(evt);
}
});
b11.setBackground(new java.awt.Color(255, 255, 204));
b11.setFont(new java.awt.Font("宋体", 0, 18));
b11.setFocusable(false);
b11.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b11.setPreferredSize(new java.awt.Dimension(41, 25));
b11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b11ActionPerformed(evt);
}
});
b12.setBackground(new java.awt.Color(255, 255, 204));
b12.setFont(new java.awt.Font("宋体", 0, 18));
b12.setFocusable(false);
b12.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b12.setPreferredSize(new java.awt.Dimension(41, 25));
b12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b12ActionPerformed(evt);
}
});
b13.setBackground(new java.awt.Color(255, 255, 204));
b13.setFont(new java.awt.Font("宋体", 0, 18));
b13.setFocusable(false);
b13.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b13.setPreferredSize(new java.awt.Dimension(41, 25));
b13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b13ActionPerformed(evt);
}
});
b14.setBackground(new java.awt.Color(255, 255, 204));
b14.setFont(new java.awt.Font("宋体", 0, 18));
b14.setFocusable(false);
b14.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b14.setPreferredSize(new java.awt.Dimension(41, 25));
b14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b14ActionPerformed(evt);
}
});
b15.setBackground(new java.awt.Color(255, 255, 204));
b15.setFont(new java.awt.Font("宋体", 0, 18));
b15.setFocusable(false);
b15.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b15.setPreferredSize(new java.awt.Dimension(41, 25));
b15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b15ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(b2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b3, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b4, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b6, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b7, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b8, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b10, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b11, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b12, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b13, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b15, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b11, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 417, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void b1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b1ActionPerformed
num=1;
jta.setText(b1.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b1ActionPerformed
private void b2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b2ActionPerformed
num=2;
jta.setText(b2.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b2ActionPerformed
private void DeletActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeletActionPerformed
switch(num)
{
case 1:
jta.setText("");
b1.setText("");
path="note1";
save();
jd.setVisible(false);
break;
case 2:
jta.setText("");
b2.setText("");
path="note2";
save();
jd.setVisible(false);
break;
case 3:
jta.setText("");
b3.setText("");
path="note3";
save();
jd.setVisible(false);
break;
case 4:
jta.setText("");
b4.setText("");
path="note4";
save();
jd.setVisible(false);
break;
case 5:
jta.setText("");
b5.setText("");
path="note5";
save();
jd.setVisible(false);
break;
case 6:
jta.setText("");
b6.setText("");
path="note6";
save();
jd.setVisible(false);
break;
case 7:
jta.setText("");
b7.setText("");
path="note7";
save();
jd.setVisible(false);
break;
case 8:
jta.setText("");
b8.setText("");
path="note8";
save();
jd.setVisible(false);
break;
case 9:
jta.setText("");
b9.setText("");
path="note9";
save();
jd.setVisible(false);
break;
case 10:
jta.setText("");
b10.setText("");
path="note10";
save();
jd.setVisible(false);
break;
case 11:
jta.setText("");
b11.setText("");
path="note11";
save();
jd.setVisible(false);
break;
case 12:
jta.setText("");
b12.setText("");
path="note12";
save();
jd.setVisible(false);
break;
case 13:
jta.setText("");
b13.setText("");
path="note13";
save();
jd.setVisible(false);
break;
case 14:
jta.setText("");
b14.setText("");
path="note14";
save();
jd.setVisible(false);
break;
case 15:
jta.setText("");
b15.setText("");
path="note15";
save();
jd.setVisible(false);
break;
}
jd.setVisible(false);
// TODO add your handling code here:
}//GEN-LAST:event_DeletActionPerformed
private void SaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveActionPerformed
switch(num)
{
case 1:
b1.setText(jta.getText());
path="note1";
save();
break;
case 2:
b2.setText(jta.getText());
path="note2";
save();
break;
case 3:
b3.setText(jta.getText());
path="note3";
save();
break;
case 4:
b4.setText(jta.getText());
path="note4";
save();
break;
case 5:
b5.setText(jta.getText());
path="note5";
save();
break;
case 6:
b6.setText(jta.getText());
path="note6";
save();
break;
case 7:
b7.setText(jta.getText());
path="note7";
save();
break;
case 8:
b8.setText(jta.getText());
path="note8";
save();
break;
case 9:
b9.setText(jta.getText());
path="note9";
save();
break;
case 10:
b10.setText(jta.getText());
path="note10";
save();
break;
case 11:
b11.setText(jta.getText());
path="note11";
save();
break;
case 12:
b12.setText(jta.getText());
path="note12";
save();
break;
case 13:
b13.setText(jta.getText());
path="note13";
save();
break;
case 14:
b14.setText(jta.getText());
path="note14";
save();
break;
case 15:
b15.setText(jta.getText());
path="note15";
save();
break;
}
jd.setVisible(false);
// TODO add your handling code here:
}//GEN-LAST:event_SaveActionPerformed
private void b3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b3ActionPerformed
num=3;
jta.setText(b3.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b3ActionPerformed
private void b4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b4ActionPerformed
num=4;
jta.setText(b4.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b4ActionPerformed
private void b5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b5ActionPerformed
num=5;
jta.setText(b5.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b5ActionPerformed
private void b6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b6ActionPerformed
num=6;
jta.setText(b6.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b6ActionPerformed
private void b7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b7ActionPerformed
num=7;
jta.setText(b7.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b7ActionPerformed
private void b8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b8ActionPerformed
num=8;
jta.setText(b8.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b8ActionPerformed
private void b9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b9ActionPerformed
num=9;
jta.setText(b9.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b9ActionPerformed
private void b10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b10ActionPerformed
num=10;
jta.setText(b10.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b10ActionPerformed
private void b11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b11ActionPerformed
num=11;
jta.setText(b11.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b11ActionPerformed
private void b12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b12ActionPerformed
num=12;
jta.setText(b12.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b12ActionPerformed
private void b13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b13ActionPerformed
num=13;
jta.setText(b13.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b13ActionPerformed
private void b14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b14ActionPerformed
num=14;
jta.setText(b14.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b14ActionPerformed
private void b15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b15ActionPerformed
num=15;
jta.setText(b15.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b15ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NoteFrame();
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Delet;
private javax.swing.JButton Save;
private javax.swing.JButton b1;
private javax.swing.JButton b10;
private javax.swing.JButton b11;
private javax.swing.JButton b12;
private javax.swing.JButton b13;
private javax.swing.JButton b14;
private javax.swing.JButton b15;
private javax.swing.JButton b2;
private javax.swing.JButton b3;
private javax.swing.JButton b4;
private javax.swing.JButton b5;
private javax.swing.JButton b6;
private javax.swing.JButton b7;
private javax.swing.JButton b8;
private javax.swing.JButton b9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JDialog jd;
private javax.swing.JTextArea jta;
// End of variables declaration//GEN-END:variables
}
* NoteFrame.java
*
* Created on 2008年9月19日, 下午5:27
*/
/**
*
* @author fyx
*/
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.*;
import java.io.*;
public class NoteFrame extends javax.swing.JFrame {
/** Creates new form NoteFrame */
int num;//标签判断
String path=null;
public NoteFrame() {
Toolkit tool=getToolkit();
Dimension screen=tool.getScreenSize();
setLocation(screen.width-425,0);
setVisible(true);
initComponents();
Open("note1",b1);
Open("note2",b2);
Open("note3",b3);
Open("note4",b4);
Open("note5",b5);
Open("note6",b6);
Open("note7",b7);
Open("note8",b8);
Open("note9",b9);
Open("note10",b10);
Open("note11",b11);
Open("note12",b12);
Open("note13",b13);
Open("note14",b14);
Open("note15",b15);
}
public void ShowDialog()//查看标签对话框显示位置
{
Toolkit tool=getToolkit();
Dimension screen=tool.getScreenSize();
jd.setLocation(screen.width-425,0);
jd.setVisible(true);
}
public void Open(String openpath,JButton b)
{
try
{
Reader in = new FileReader(openpath);
BufferedReader br=new BufferedReader(in);
String ot=null;String opent="";
while((ot=br.readLine())!=null)
{
opent=opent+ot+"/n";
}
b.setText(opent);
}
catch(IOException io)
{
System.err.println("IOException: " + io.getMessage());
}
}
public void save()
{
String t=jta.getText();
FileOutputStream fstrm = null;
BufferedOutputStream ostrm = null;
try
{
fstrm = new FileOutputStream(path);
ostrm = new BufferedOutputStream(fstrm);
byte[] bytes = null;
try
{
bytes =t.getBytes();
ostrm.write(bytes);
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
catch(IOException io)
{
System.err.println("IOException: " + io.getMessage());
}
finally
{
try
{
ostrm.flush();
fstrm.close();
ostrm.close();
}
catch(IOException ioe)
{
System.err.println("IOException: " + ioe.getMessage());
}
}
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jd = new javax.swing.JDialog();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jta = new javax.swing.JTextArea();
Delet = new javax.swing.JButton();
Save = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
b1 = new javax.swing.JButton();
b2 = new javax.swing.JButton();
b3 = new javax.swing.JButton();
b4 = new javax.swing.JButton();
b5 = new javax.swing.JButton();
b6 = new javax.swing.JButton();
b7 = new javax.swing.JButton();
b8 = new javax.swing.JButton();
b9 = new javax.swing.JButton();
b10 = new javax.swing.JButton();
b11 = new javax.swing.JButton();
b12 = new javax.swing.JButton();
b13 = new javax.swing.JButton();
b14 = new javax.swing.JButton();
b15 = new javax.swing.JButton();
jd.setTitle("标签内容查看");
jd.setBackground(new java.awt.Color(255, 255, 204));
jd.setMinimumSize(new java.awt.Dimension(424, 407));
jd.setModal(true);
jd.setResizable(false);
jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 204)));
jPanel2.setForeground(new java.awt.Color(255, 255, 204));
jPanel2.setMinimumSize(new java.awt.Dimension(424, 407));
jta.setBackground(new java.awt.Color(255, 255, 204));
jta.setColumns(20);
jta.setFont(new java.awt.Font("文鼎PL中楷Uni", 0, 18)); // NOI18N
jta.setLineWrap(true);
jta.setRows(5);
jta.setWrapStyleWord(true);
jta.setMinimumSize(new java.awt.Dimension(50, 23));
jScrollPane1.setViewportView(jta);
Delet.setText("删除");
Delet.setFocusable(false);
Delet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DeletActionPerformed(evt);
}
});
Save.setText("保存");
Save.setFocusable(false);
Save.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SaveActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(83, 83, 83)
.addComponent(Save, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Delet, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(68, 68, 68))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
.addContainerGap()))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(332, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(Delet)
.addComponent(Save))
.addGap(50, 50, 50))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(94, Short.MAX_VALUE)))
);
javax.swing.GroupLayout jdLayout = new javax.swing.GroupLayout(jd.getContentPane());
jd.getContentPane().setLayout(jdLayout);
jdLayout.setHorizontalGroup(
jdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 407, Short.MAX_VALUE)
);
jdLayout.setVerticalGroup(
jdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("标签列表");
setBackground(new java.awt.Color(255, 255, 204));
setResizable(false);
jPanel1.setBackground(new java.awt.Color(255, 255, 204));
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 204)));
jPanel1.setForeground(new java.awt.Color(255, 255, 204));
jPanel1.setMaximumSize(new java.awt.Dimension(425, 400));
jPanel1.setMinimumSize(new java.awt.Dimension(425, 400));
jPanel1.setOpaque(false);
jPanel1.setPreferredSize(new java.awt.Dimension(425, 400));
jPanel1.setRequestFocusEnabled(false);
b1.setBackground(new java.awt.Color(255, 255, 204));
b1.setFont(new java.awt.Font("宋体", 0, 18));
b1.setFocusable(false);
b1.setHideActionText(true);
b1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b1.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
b1.setPreferredSize(new java.awt.Dimension(40, 25));
b1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b1ActionPerformed(evt);
}
});
b2.setBackground(new java.awt.Color(255, 255, 204));
b2.setFont(new java.awt.Font("宋体", 0, 18));
b2.setFocusable(false);
b2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b2.setPreferredSize(new java.awt.Dimension(41, 25));
b2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b2ActionPerformed(evt);
}
});
b3.setBackground(new java.awt.Color(255, 255, 204));
b3.setFont(new java.awt.Font("宋体", 0, 18));
b3.setFocusable(false);
b3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b3.setInheritsPopupMenu(true);
b3.setPreferredSize(new java.awt.Dimension(41, 25));
b3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b3ActionPerformed(evt);
}
});
b4.setBackground(new java.awt.Color(255, 255, 204));
b4.setFont(new java.awt.Font("宋体", 0, 18));
b4.setFocusable(false);
b4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b4.setPreferredSize(new java.awt.Dimension(41, 25));
b4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b4ActionPerformed(evt);
}
});
b5.setBackground(new java.awt.Color(255, 255, 204));
b5.setFont(new java.awt.Font("宋体", 0, 18));
b5.setFocusable(false);
b5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b5.setPreferredSize(new java.awt.Dimension(41, 25));
b5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b5ActionPerformed(evt);
}
});
b6.setBackground(new java.awt.Color(255, 255, 204));
b6.setFont(new java.awt.Font("宋体", 0, 18));
b6.setFocusable(false);
b6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b6.setPreferredSize(new java.awt.Dimension(41, 25));
b6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b6ActionPerformed(evt);
}
});
b7.setBackground(new java.awt.Color(255, 255, 204));
b7.setFont(new java.awt.Font("宋体", 0, 18));
b7.setFocusable(false);
b7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b7.setPreferredSize(new java.awt.Dimension(41, 25));
b7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b7ActionPerformed(evt);
}
});
b8.setBackground(new java.awt.Color(255, 255, 204));
b8.setFont(new java.awt.Font("宋体", 0, 18));
b8.setFocusable(false);
b8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b8.setPreferredSize(new java.awt.Dimension(41, 25));
b8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b8ActionPerformed(evt);
}
});
b9.setBackground(new java.awt.Color(255, 255, 204));
b9.setFont(new java.awt.Font("宋体", 0, 18));
b9.setFocusable(false);
b9.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b9.setPreferredSize(new java.awt.Dimension(41, 25));
b9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b9ActionPerformed(evt);
}
});
b10.setBackground(new java.awt.Color(255, 255, 204));
b10.setFont(new java.awt.Font("宋体", 0, 18));
b10.setFocusable(false);
b10.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b10.setPreferredSize(new java.awt.Dimension(41, 25));
b10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b10ActionPerformed(evt);
}
});
b11.setBackground(new java.awt.Color(255, 255, 204));
b11.setFont(new java.awt.Font("宋体", 0, 18));
b11.setFocusable(false);
b11.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b11.setPreferredSize(new java.awt.Dimension(41, 25));
b11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b11ActionPerformed(evt);
}
});
b12.setBackground(new java.awt.Color(255, 255, 204));
b12.setFont(new java.awt.Font("宋体", 0, 18));
b12.setFocusable(false);
b12.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b12.setPreferredSize(new java.awt.Dimension(41, 25));
b12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b12ActionPerformed(evt);
}
});
b13.setBackground(new java.awt.Color(255, 255, 204));
b13.setFont(new java.awt.Font("宋体", 0, 18));
b13.setFocusable(false);
b13.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b13.setPreferredSize(new java.awt.Dimension(41, 25));
b13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b13ActionPerformed(evt);
}
});
b14.setBackground(new java.awt.Color(255, 255, 204));
b14.setFont(new java.awt.Font("宋体", 0, 18));
b14.setFocusable(false);
b14.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b14.setPreferredSize(new java.awt.Dimension(41, 25));
b14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b14ActionPerformed(evt);
}
});
b15.setBackground(new java.awt.Color(255, 255, 204));
b15.setFont(new java.awt.Font("宋体", 0, 18));
b15.setFocusable(false);
b15.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
b15.setPreferredSize(new java.awt.Dimension(41, 25));
b15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
b15ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(b2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b3, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b4, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b6, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b7, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b8, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b10, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b11, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b12, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b13, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
.addComponent(b15, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(b1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b11, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(b15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 417, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void b1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b1ActionPerformed
num=1;
jta.setText(b1.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b1ActionPerformed
private void b2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b2ActionPerformed
num=2;
jta.setText(b2.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b2ActionPerformed
private void DeletActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeletActionPerformed
switch(num)
{
case 1:
jta.setText("");
b1.setText("");
path="note1";
save();
jd.setVisible(false);
break;
case 2:
jta.setText("");
b2.setText("");
path="note2";
save();
jd.setVisible(false);
break;
case 3:
jta.setText("");
b3.setText("");
path="note3";
save();
jd.setVisible(false);
break;
case 4:
jta.setText("");
b4.setText("");
path="note4";
save();
jd.setVisible(false);
break;
case 5:
jta.setText("");
b5.setText("");
path="note5";
save();
jd.setVisible(false);
break;
case 6:
jta.setText("");
b6.setText("");
path="note6";
save();
jd.setVisible(false);
break;
case 7:
jta.setText("");
b7.setText("");
path="note7";
save();
jd.setVisible(false);
break;
case 8:
jta.setText("");
b8.setText("");
path="note8";
save();
jd.setVisible(false);
break;
case 9:
jta.setText("");
b9.setText("");
path="note9";
save();
jd.setVisible(false);
break;
case 10:
jta.setText("");
b10.setText("");
path="note10";
save();
jd.setVisible(false);
break;
case 11:
jta.setText("");
b11.setText("");
path="note11";
save();
jd.setVisible(false);
break;
case 12:
jta.setText("");
b12.setText("");
path="note12";
save();
jd.setVisible(false);
break;
case 13:
jta.setText("");
b13.setText("");
path="note13";
save();
jd.setVisible(false);
break;
case 14:
jta.setText("");
b14.setText("");
path="note14";
save();
jd.setVisible(false);
break;
case 15:
jta.setText("");
b15.setText("");
path="note15";
save();
jd.setVisible(false);
break;
}
jd.setVisible(false);
// TODO add your handling code here:
}//GEN-LAST:event_DeletActionPerformed
private void SaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveActionPerformed
switch(num)
{
case 1:
b1.setText(jta.getText());
path="note1";
save();
break;
case 2:
b2.setText(jta.getText());
path="note2";
save();
break;
case 3:
b3.setText(jta.getText());
path="note3";
save();
break;
case 4:
b4.setText(jta.getText());
path="note4";
save();
break;
case 5:
b5.setText(jta.getText());
path="note5";
save();
break;
case 6:
b6.setText(jta.getText());
path="note6";
save();
break;
case 7:
b7.setText(jta.getText());
path="note7";
save();
break;
case 8:
b8.setText(jta.getText());
path="note8";
save();
break;
case 9:
b9.setText(jta.getText());
path="note9";
save();
break;
case 10:
b10.setText(jta.getText());
path="note10";
save();
break;
case 11:
b11.setText(jta.getText());
path="note11";
save();
break;
case 12:
b12.setText(jta.getText());
path="note12";
save();
break;
case 13:
b13.setText(jta.getText());
path="note13";
save();
break;
case 14:
b14.setText(jta.getText());
path="note14";
save();
break;
case 15:
b15.setText(jta.getText());
path="note15";
save();
break;
}
jd.setVisible(false);
// TODO add your handling code here:
}//GEN-LAST:event_SaveActionPerformed
private void b3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b3ActionPerformed
num=3;
jta.setText(b3.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b3ActionPerformed
private void b4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b4ActionPerformed
num=4;
jta.setText(b4.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b4ActionPerformed
private void b5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b5ActionPerformed
num=5;
jta.setText(b5.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b5ActionPerformed
private void b6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b6ActionPerformed
num=6;
jta.setText(b6.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b6ActionPerformed
private void b7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b7ActionPerformed
num=7;
jta.setText(b7.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b7ActionPerformed
private void b8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b8ActionPerformed
num=8;
jta.setText(b8.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b8ActionPerformed
private void b9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b9ActionPerformed
num=9;
jta.setText(b9.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b9ActionPerformed
private void b10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b10ActionPerformed
num=10;
jta.setText(b10.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b10ActionPerformed
private void b11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b11ActionPerformed
num=11;
jta.setText(b11.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b11ActionPerformed
private void b12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b12ActionPerformed
num=12;
jta.setText(b12.getText());
ShowDialog();// TODO add your handling code here:
}//GEN-LAST:event_b12ActionPerformed
private void b13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b13ActionPerformed
num=13;
jta.setText(b13.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b13ActionPerformed
private void b14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b14ActionPerformed
num=14;
jta.setText(b14.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b14ActionPerformed
private void b15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_b15ActionPerformed
num=15;
jta.setText(b15.getText());
ShowDialog();
// TODO add your handling code here:
}//GEN-LAST:event_b15ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NoteFrame();
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Delet;
private javax.swing.JButton Save;
private javax.swing.JButton b1;
private javax.swing.JButton b10;
private javax.swing.JButton b11;
private javax.swing.JButton b12;
private javax.swing.JButton b13;
private javax.swing.JButton b14;
private javax.swing.JButton b15;
private javax.swing.JButton b2;
private javax.swing.JButton b3;
private javax.swing.JButton b4;
private javax.swing.JButton b5;
private javax.swing.JButton b6;
private javax.swing.JButton b7;
private javax.swing.JButton b8;
private javax.swing.JButton b9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JDialog jd;
private javax.swing.JTextArea jta;
// End of variables declaration//GEN-END:variables
}