?? mainframe.java
字號:
}
});
jToolBar1.add(jCheckBox1);
listButton.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 255), 1, true));
listButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
listButtonActionPerformed(evt);
}
});
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(20, 20, 20)
.add(listButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 263, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 24, Short.MAX_VALUE)
.add(countLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(listButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(countLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 129, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
jMenuBar1.setBackground(java.awt.SystemColor.inactiveCaptionText);
fileMenu.setBackground(java.awt.SystemColor.inactiveCaptionText);
fileMenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/file.gif")));
fileMenu.setText("\u6587\u4ef6");
fileMenu.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
fileMenuActionPerformed(evt);
}
});
openItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/open.png")));
openItem.setMnemonic('N');
openItem.setText("\u6253\u5f00");
openItem.setPreferredSize(new java.awt.Dimension(60, 20));
openItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
openItemActionPerformed(evt);
}
});
fileMenu.add(openItem);
configItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/config.gif")));
configItem.setMnemonic('C');
configItem.setText("\u8bbe\u7f6e");
configItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
configItemActionPerformed(evt);
}
});
fileMenu.add(configItem);
sendItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, java.awt.event.InputEvent.CTRL_MASK));
sendItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/send.gif")));
sendItem.setText("\u53d1\u9001");
sendItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
sendItemActionPerformed(evt);
}
});
fileMenu.add(sendItem);
exitItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/exit.gif")));
exitItem.setMnemonic('X');
exitItem.setText("\u9000\u51fa");
exitItem.setActionCommand("\u4f20\u9001\u72b6\u6001");
exitItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
exitItemActionPerformed(evt);
}
});
fileMenu.add(exitItem);
jMenuBar1.add(fileMenu);
helpMenu.setBackground(java.awt.SystemColor.inactiveCaptionText);
helpMenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/help.gif")));
helpMenu.setText("\u5e2e\u52a9");
jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/trans/resourses/about.gif")));
jMenuItem4.setText("\u5173\u4e8e");
jMenuItem4.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jMenuItem4ActionPerformed(evt);
}
});
helpMenu.add(jMenuItem4);
jMenuBar1.add(helpMenu);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void sendItemActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_sendItemActionPerformed
{//GEN-HEADEREND:event_sendItemActionPerformed
// TODO 將在此處添加您的處理代碼:
send();
}//GEN-LAST:event_sendItemActionPerformed
private void jMenuItem2ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem2ActionPerformed
{//GEN-HEADEREND:event_jMenuItem2ActionPerformed
// TODO 將在此處添加您的處理代碼:
send();
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void menuItem4ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_menuItem4ActionPerformed
{//GEN-HEADEREND:event_menuItem4ActionPerformed
// TODO 將在此處添加您的處理代碼:
System.exit ( 0 );
}//GEN-LAST:event_menuItem4ActionPerformed
private void menuItem3ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_menuItem3ActionPerformed
{//GEN-HEADEREND:event_menuItem3ActionPerformed
// TODO 將在此處添加您的處理代碼:
JOptionPane.showMessageDialog(this, " Made by pengfei\nE-mail:pengfei.qiu@yahoo.com.cn","關于", JOptionPane.INFORMATION_MESSAGE);
}//GEN-LAST:event_menuItem3ActionPerformed
private void menuItem2ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_menuItem2ActionPerformed
{//GEN-HEADEREND:event_menuItem2ActionPerformed
// TODO 將在此處添加您的處理代碼:
m.setVisible (true);
ConfigFrame c = new ConfigFrame();
c.setLocationRelativeTo ( this );
c.setVisible ( true );
c.pack ();
}//GEN-LAST:event_menuItem2ActionPerformed
private void menuItem1ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_menuItem1ActionPerformed
{//GEN-HEADEREND:event_menuItem1ActionPerformed
// TODO 將在此處添加您的處理代碼:
this.setVisible ( true );
this.setState ( JFrame.NORMAL );
}//GEN-LAST:event_menuItem1ActionPerformed
private void formWindowIconified (java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowIconified
{//GEN-HEADEREND:event_formWindowIconified
// TODO 將在此處添加您的處理代碼:
this.setVisible ( false );
}//GEN-LAST:event_formWindowIconified
private void jButton1ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
{//GEN-HEADEREND:event_jButton1ActionPerformed
// TODO 將在此處添加您的處理代碼:
ConfigFrame c = new ConfigFrame();
c.setLocationRelativeTo ( this );
c.setVisible ( true );
c.pack ();
}//GEN-LAST:event_jButton1ActionPerformed
private void jMenuItem1ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem1ActionPerformed
{//GEN-HEADEREND:event_jMenuItem1ActionPerformed
// TODO 將在此處添加您的處理代碼:
start();
}//GEN-LAST:event_jMenuItem1ActionPerformed
private void jCheckBox1StateChanged (javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jCheckBox1StateChanged
{//GEN-HEADEREND:event_jCheckBox1StateChanged
// TODO 將在此處添加您的處理代碼:
accRe = jCheckBox1.isSelected ();
}//GEN-LAST:event_jCheckBox1StateChanged
private void jMenuItem6ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem6ActionPerformed
{//GEN-HEADEREND:event_jMenuItem6ActionPerformed
// TODO 將在此處添加您的處理代碼:
ConfigFrame c = new ConfigFrame();
c.setLocationRelativeTo ( this );
c.setVisible ( true );
c.pack ();
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void jMenuItem5ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem5ActionPerformed
{//GEN-HEADEREND:event_jMenuItem5ActionPerformed
// TODO 將在此處添加您的處理代碼:
openFile();
if( fileVector.size () > 0 ) paintList();
}//GEN-LAST:event_jMenuItem5ActionPerformed
private void jMenuItem4ActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem4ActionPerformed
{//GEN-HEADEREND:event_jMenuItem4ActionPerformed
// TODO 將在此處添加您的處理代碼:
JOptionPane.showMessageDialog(this, " Made by pengfei\nE-mail:pengfei.qiu@yahoo.com.cn","關于", JOptionPane.INFORMATION_MESSAGE);
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void configItemActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_configItemActionPerformed
{//GEN-HEADEREND:event_configItemActionPerformed
// TODO 將在此處添加您的處理代碼:
ConfigFrame c = new ConfigFrame();
c.setLocationRelativeTo ( this );
c.setVisible ( true );
c.pack ();
}//GEN-LAST:event_configItemActionPerformed
private void exitItemActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_exitItemActionPerformed
{//GEN-HEADEREND:event_exitItemActionPerformed
// TODO 將在此處添加您的處理代碼:
System.exit (0);
}//GEN-LAST:event_exitItemActionPerformed
private void jToolBar1MouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_jToolBar1MouseClicked
{//GEN-HEADEREND:event_jToolBar1MouseClicked
// TODO 將在此處添加您的處理代碼:
int mods=evt.getModifiers();
//鼠標右鍵
if((mods&InputEvent.BUTTON3_MASK)!=0)
rightMouseMenu.show(jToolBar1, evt.getX(), evt.getY());
}//GEN-LAST:event_jToolBar1MouseClicked
private void listButtonActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_listButtonActionPerformed
{//GEN-HEADEREND:event_listButtonActionPerformed
// TODO 將在此處添加您的處理代碼:
// f = new JFrame();
// f.setTitle ("準備發送的文件列表");
// model = new DefaultTableModel(
// new Object [][]{},
// new String []{"文件名","大小","位置"}
// );
// table = new JTable();
// table.setModel ( model );
// p = new JPanel();
// p.setLayout ( new BorderLayout());
// delButton = new JButton( "刪除" );
// p.add ( new JScrollPane(table),"Center" );
// p.add ( delButton, "South");
// f.add (p);
// for ( int i = 0 ; i < m.fileVector.size () ; i ++)
// {
// File temp = ( File ) m.fileVector.get ( i );
// model.addRow ( new Object []{ temp.getName () ,temp.length () / 1024 + "KB",temp.getPath () } );
// }
// delButton.addActionListener (new java.awt.event.ActionListener()
// {
// public void actionPerformed(java.awt.event.ActionEvent evt)
// {
//
// int index = table.getSelectedRow ();
// while ( index != -1 )
// {
// model.removeRow ( index );
// m.fileVector.remove ( index );
// index = table.getSelectedRow ();
// }
// paintList();
// }
// });
// f.setSize ( 400,200 );
// f.setVisible ( true ) ;
fileSelect f = new fileSelect ( m.fileVector ,"" , 1 );
f.setVisible ( true );
}//GEN-LAST:event_listButtonActionPerformed
private void sendButtonActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_sendButtonActionPerformed
{//GEN-HEADEREND:event_sendButtonActionPerformed
// TODO 將在此處添加您的處理代碼:
send();
}//GEN-LAST:event_sendButtonActionPerformed
private void openItemActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_openItemActionPerformed
{//GEN-HEADEREND:event_openItemActionPerformed
// TODO 將在此處添加您的處理代碼:
openFile();
if( fileVector.size () > 0 ) paintList();
}//GEN-LAST:event_openItemActionPerformed
private void refreshButtonActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_refreshButtonActionPerformed
{//GEN-HEADEREND:event_refreshButtonActionPerformed
// TODO 將在此處添加您的處理代碼:
start();
}//GEN-LAST:event_refreshButtonActionPerformed
private void jScrollPane1MouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_jScrollPane1MouseClicked
{//GEN-HEADEREND:event_jScrollPane1MouseClicked
// TODO 將在此處添加您的處理代碼:
// TODO 將在此處添加您的處理代碼:
int mods=evt.getModifiers();
//鼠標右鍵
if((mods&InputEvent.BUTTON3_MASK)!=0)
rightMouseMenu.show(jScrollPane1, evt.getX(), evt.getY());
}//GEN-LAST:event_jScrollPane1MouseClicked
private void msgTAMouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_msgTAMouseClicked
{//GEN-HEADEREND:event_msgTAMouseClicked
// TODO 將在此處添加您的處理代碼:
}//GEN-LAST:event_msgTAMouseClicked
private void infoTableMouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_infoTableMouseClicked
{//GEN-HEADEREND:event_infoTableMouseClicked
// TODO 將在此處添加您的處理代碼:
int mods=evt.getModifiers();
//鼠標右鍵
if((mods&InputEvent.BUTTON3_MASK)!=0)
rightMouseMenu.show(infoTable, evt.getX(), evt.getY());
}//GEN-LAST:event_infoTableMouseClicked
private void formMouseClicked (java.awt.event.MouseEvent evt)//GEN-FIRST:event_formMouseClicked
{//GEN-HEADEREND:event_formMouseClicked
// TODO 將在此處添加您的處理代碼:
int mods=evt.getModifiers();
//鼠標右鍵
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -