?? recordopt.java
字號:
/* * RecordOpt.java * * Created on 3 ottobre 2005, 20.18 *//** * * @author enrik */public class RecordOpt extends javax.swing.JDialog{ private int mquality =-1; private int mminutes = 0; private boolean mbsaved = false; /** Creates new form RecordOpt */ public RecordOpt() { initComponents(); setBounds(10, 100, 320, 215); } public boolean isSaved() { return mbsaved; } public int getQuality() { return new Integer(mquality).intValue(); } public int getMinutes() { return new Integer(mminutes).intValue(); } /** 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. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jLabel1 = new javax.swing.JLabel(); jTxtRecordMin = new javax.swing.JTextField(); jBtnSave = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); getContentPane().setLayout(null); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setLayout(null); jPanel1.setBorder(new javax.swing.border.TitledBorder("Recording Quality:")); jRadioButton1.setText("PAL DVD (1h)"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); jPanel1.add(jRadioButton1); jRadioButton1.setBounds(10, 20, 290, 23); jRadioButton2.setText("PAL half-DVD (2h)"); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton2ActionPerformed(evt); } }); jPanel1.add(jRadioButton2); jRadioButton2.setBounds(10, 40, 290, 23); jRadioButton3.setSelected(true); jRadioButton3.setText("PAL half-DVD (4h)"); jRadioButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton3ActionPerformed(evt); } }); jPanel1.add(jRadioButton3); jRadioButton3.setBounds(10, 60, 290, 23); getContentPane().add(jPanel1); jPanel1.setBounds(0, 0, 310, 90); jLabel1.setText("Record duration (minutes):"); getContentPane().add(jLabel1); jLabel1.setBounds(10, 100, 200, 15); jTxtRecordMin.setText("0"); jTxtRecordMin.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTxtRecordMinActionPerformed(evt); } }); getContentPane().add(jTxtRecordMin); jTxtRecordMin.setBounds(210, 100, 40, 19); jBtnSave.setText("Save Settings"); jBtnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBtnSaveActionPerformed(evt); } }); getContentPane().add(jBtnSave); jBtnSave.setBounds(167, 150, 140, 25); jLabel2.setText("NOTE: must be between 0 and 250"); getContentPane().add(jLabel2); jLabel2.setBounds(10, 120, 290, 20); pack(); } // </editor-fold>//GEN-END:initComponents private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButton1ActionPerformed {//GEN-HEADEREND:event_jRadioButton1ActionPerformed// TODO add your handling code here: jRadioButton2.setSelected(false); jRadioButton3.setSelected(false); }//GEN-LAST:event_jRadioButton1ActionPerformed private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButton2ActionPerformed {//GEN-HEADEREND:event_jRadioButton2ActionPerformed jRadioButton1.setSelected(false); jRadioButton3.setSelected(false); }//GEN-LAST:event_jRadioButton2ActionPerformed private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButton3ActionPerformed {//GEN-HEADEREND:event_jRadioButton3ActionPerformed// TODO add your handling code here: jRadioButton1.setSelected(false); jRadioButton2.setSelected(false); }//GEN-LAST:event_jRadioButton3ActionPerformed private void jTxtRecordMinActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jTxtRecordMinActionPerformed {//GEN-HEADEREND:event_jTxtRecordMinActionPerformed// TODO add your handling code here: }//GEN-LAST:event_jTxtRecordMinActionPerformed private void jBtnSaveActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jBtnSaveActionPerformed {//GEN-HEADEREND:event_jBtnSaveActionPerformed // read active radio button if (jRadioButton1.isSelected()) { mquality = TvActions.MODE_PAL_DVD; } else if (jRadioButton2.isSelected()) { mquality = TvActions.MODE_PAL_DVD_LONG_PLAY; } else if (jRadioButton3.isSelected()) { mquality = TvActions.MODE_PAL_DVD_EXTRA_LONG_PLAY; } mminutes = new Integer(jTxtRecordMin.getText().trim()).intValue(); if (mminutes < 1 || mminutes > 250) { mminutes = 250; } this.setVisible(false); mbsaved = true; }//GEN-LAST:event_jBtnSaveActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new RecordOpt().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jBtnSave; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; private javax.swing.JRadioButton jRadioButton1; private javax.swing.JRadioButton jRadioButton2; private javax.swing.JRadioButton jRadioButton3; private javax.swing.JTextField jTxtRecordMin; // End of variables declaration//GEN-END:variables }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -