I do not know how to add hyphens and try and catch statement

kandiman1010
newjframe.java

package newpackage; import javax.swing.JFrame; /** * * @author Kandiman */ public class NewJFrame extends JFrame { /** * Creates new form NewJFrame */ public NewJFrame() { initComponents(); init(); } private void init(){ setVisible(true); setTitle("Job Test"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationRelativeTo(null); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { txt1Input = new javax.swing.JTextField(); txt2Input = new javax.swing.JTextField(); txt3Input = new javax.swing.JTextField(); txt1Output = new javax.swing.JTextField(); txt2Output = new javax.swing.JTextField(); txt3Output = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); btnDisplayResults = new javax.swing.JButton(); btnClear = new javax.swing.JButton(); btnExit = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); txt1Input.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt1InputActionPerformed(evt); } }); txt1Output.setEnabled(false); txt1Output.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt1OutputActionPerformed(evt); } }); txt2Output.setEnabled(false); txt2Output.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt2OutputActionPerformed(evt); } }); txt3Output.setEnabled(false); jLabel1.setText("Enter Alpha Characters"); jLabel1.setMaximumSize(new java.awt.Dimension(138, 14)); jLabel1.setMinimumSize(new java.awt.Dimension(138, 14)); jLabel1.setPreferredSize(new java.awt.Dimension(138, 14)); jLabel1.setVerifyInputWhenFocusTarget(false); btnDisplayResults.setText("Display Results"); btnDisplayResults.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDisplayResultsActionPerformed(evt); } }); btnClear.setText("Clear"); btnClear.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnClearActionPerformed(evt); } }); btnExit.setText("Exit"); btnExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExitActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(53, 53, 53) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txt3Input) .addComponent(txt1Output, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) .addComponent(txt2Output, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) .addComponent(txt3Output, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) .addComponent(txt1Input) .addComponent(txt2Input) .addComponent(btnDisplayResults, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(btnClear, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt1Input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txt2Input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt3Input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnDisplayResults, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txt1Output, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txt2Output, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(txt3Output, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(13, 13, 13) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnClear) .addComponent(btnExit)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void txt1InputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt1InputActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txt1InputActionPerformed private void btnDisplayResultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDisplayResultsActionPerformed // TODO add your handling code here: String text1 = txt1Input.getText(); txt1Output.setText(text1); String text2 = txt2Input.getText(); txt2Output.setText(text2); String text3 = txt3Input.getText(); txt3Output.setText(text3); }//GEN-LAST:event_btnDisplayResultsActionPerformed private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed //Close the application System.exit(1); }//GEN-LAST:event_btnExitActionPerformed private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClearActionPerformed //Clear all text fields and disable the output text fields txt1Input.setText(""); txt2Input.setText(""); txt3Input.setText(""); txt1Output.setText(""); txt2Output.setText(""); txt3Output.setText(""); }//GEN-LAST:event_btnClearActionPerformed private void txt2OutputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt2OutputActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txt2OutputActionPerformed private void txt1OutputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt1OutputActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txt1OutputActionPerformed public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } new NewJFrame(); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnClear; private javax.swing.JButton btnDisplayResults; private javax.swing.JButton btnExit; private javax.swing.JLabel jLabel1; private javax.swing.JTextField txt1Input; private javax.swing.JTextField txt1Output; private javax.swing.JTextField txt2Input; private javax.swing.JTextField txt2Output; private javax.swing.JTextField txt3Input; private javax.swing.JTextField txt3Output; // End of variables declaration//GEN-END:variables }