Package java.awt.event

Examples of java.awt.event.FocusListener


        Box boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("ID"));
         
          txtID = new JTextArea();
          txtID.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtID.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setId(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtID);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Access"));
         
          txtAccess = new JTextArea();
          txtAccess.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtAccess.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setAccess(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAccess);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Name"));
         
          txtName = new JTextArea();
          txtName.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtName.getText();
                try {
                  if((txt == null) || (txt.length() == 0))
                    rsAccount.setName(null);
                  else
                    rsAccount.setName(txt);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtName);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Created"));
         
          txtCreated = new JTextArea();
          txtCreated.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtCreated.getText();
                Timestamp value = null;
                try {value = new Timestamp(TimeFormatter.parseDateTime(txt));} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setCreated(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtCreated);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Last Rank Change"));
         
          txtLastRankChange = new JTextArea();
          txtLastRankChange.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtLastRankChange.getText();
                Timestamp value = null;
                try {value = new Timestamp(TimeFormatter.parseDateTime(txt));} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setLastRankChange(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtLastRankChange);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Created By"));
         
          txtCreatedBy = new JTextArea();
          txtCreatedBy.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtCreatedBy.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setCreatedBy(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtCreatedBy);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Trivia Correct"));
         
          txtTriviaCorrect = new JTextArea();
          txtTriviaCorrect.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtTriviaCorrect.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setTriviaCorrect(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtTriviaCorrect);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Trivia Win"));
         
          txtTriviaWin = new JTextArea();
          txtTriviaWin.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtTriviaWin.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsAccount.setTriviaWin(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtTriviaWin);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("Birthday"));
         
          txtBirthday = new JTextArea();
          txtBirthday.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsAccount != null) {
                String txt = txtBirthday.getText();
                java.sql.Date value = null;
View Full Code Here


        Box boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("ID"));
         
          txtID = new JTextArea();
          txtID.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtID.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value != null)
                    rsRank.setId(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtID);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("shortPrefix"));
         
          txtShortPrefix = new JTextArea();
          txtShortPrefix.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtShortPrefix.getText();
                try {
                  if((txt == null) || (txt.length() == 0))
                    rsRank.setShortPrefix(null);
                  else
                    rsRank.setShortPrefix(txt);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtShortPrefix);
        }
        majorRows.add(boxLine);
       
        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("prefix"));
         
          txtPrefix = new JTextArea();
          txtPrefix.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtPrefix.getText();
                try {
                  if((txt == null) || (txt.length() == 0))
                    rsRank.setPrefix(null);
                  else
                    rsRank.setPrefix(txt);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtPrefix);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("verbstr"));
         
          txtVerbstr = new JTextArea();
          txtVerbstr.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtVerbstr.getText();
                try {
                  if((txt == null) || (txt.length() == 0))
                    rsRank.setVerbStr(null);
                  else
                    rsRank.setVerbStr(txt);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtVerbstr);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("greeting"));
         
          txtGreeting = new JTextArea();
          txtGreeting.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtGreeting.getText();
                try {
                  if((txt == null) || (txt.length() == 0))
                    rsRank.setGreeting(null);
                  else
                    rsRank.setGreeting(txt);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtGreeting);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("expireDays"));
         
          txtExpireDays = new JTextArea();
          txtExpireDays.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtExpireDays.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setExpireDays(null);
                  else
                    rsRank.setExpireDays(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtExpireDays);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apDays"));
         
          txtAPDays = new JTextArea();
          txtAPDays.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPDays.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setApDays(null);
                  else
                    rsRank.setApDays(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAPDays);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apRecruitScore"));
         
          txtAPRS = new JTextArea();
          txtAPRS.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPRS.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setApRecruitScore(null);
                  else
                    rsRank.setApRecruitScore(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAPRS);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apWins"));
         
          txtAPWins = new JTextArea();
          txtAPWins.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPWins.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setApWins(null);
                  else
                    rsRank.setApWins(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAPWins);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apD2Level"));
         
          txtAPD2Level = new JTextArea();
          txtAPD2Level.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPD2Level.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setApD2Level(null);
                  else
                    rsRank.setApD2Level(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAPD2Level);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apW3Level"));
         
          txtAPW3Level = new JTextArea();
          txtAPW3Level.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPW3Level.getText();
                Long value = null;
                try {value = Long.parseLong(txt);} catch(Exception e) {}
                try {
                  if(value == null)
                    rsRank.setApW3Level(null);
                  else
                    rsRank.setApW3Level(value);
                } catch (SQLException e) {
                  e.printStackTrace();
                }
              }
            }
          });
          boxLine.add(txtAPW3Level);
        }
        majorRows.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          boxLine.add(new JLabel("apMail"));
         
          txtAPMail = new JTextArea();
          txtAPMail.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent arg0) {}
            public void focusLost(FocusEvent arg0) {
              if(rsRank != null) {
                String txt = txtAPMail.getText();
                try {
View Full Code Here

      cbs.put(cb, Integer.valueOf(f));
    }

    add(ctf = new ConfigNumericHexTextField(flags));
    ctf.setEnabled(false);
    ctf.addFocusListener(new FocusListener() {
      @Override
      public void focusGained(FocusEvent e) {}
      @Override
      public void focusLost(FocusEvent e) {
        setFlags(ctf.getValue());
View Full Code Here

    mTextArea.setLineWrap(true);
    mTextArea.setWrapStyleWord(true);
      // Register the handler for focus listening. This handler will
      // only notify the registered when the text changes from when
      // the focus is gained to when it is lost.
      mTextArea.addFocusListener(new FocusListener(){

        String oldValue = ""; // A temporary cache.

        /**
         * Callback method when the focus to the Text Field component
View Full Code Here

   {
    this.setLayout(new FlowLayout(FlowLayout.LEFT));
      // Register the handler for focus listening. This handler will
      // only notify the registered when the text changes from when
      // the focus is gained to when it is lost.
      mTextField.addFocusListener(new FocusListener(){

        String oldValue = ""; // A temporary cache.

        /**
         * Callback method when the focus to the Text Field component
View Full Code Here

                    gainedOFM = context.getBindableMethod(gained);
                    if (gainedOFM == null) {
                        throw new BindingException("could not find bindable method: " + gained);
                    }
                }
                FocusListener focusListener = new FocusListener() {
                    public void focusGained(FocusEvent e) {
                        try {
                            if (gainedOFM != null) {
                                boolean accessible = gainedOFM.getMethod().isAccessible();
                                gainedOFM.getMethod().setAccessible(true);
View Full Code Here

        cloudReportPane.setFont(plainCommentFont);
        //        cloudReportPane.setEditorKit(new HTMLEditorKit());
        //        ((HTMLEditorKit) cloudReportPane.getDocument()).getStyleSheet().addRule("body { font-");

        setDefaultComment(MSG_REVIEW);
        commentBox.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent e) {
                commentBox.setForeground(null);
                commentBox.setFont(plainCommentFont);
                if (isDefaultComment(commentBox.getText())) {
View Full Code Here

    this.designTimeContext = context;

    this.queriesTableModel = new QueriesTableModel();
    queriesTable = new JTable(queriesTableModel);
    baseUrl = new JTextField();
    baseUrl.addFocusListener(new FocusListener() {
      public void focusLost(FocusEvent e) {
        checkBaseUrl();
      }
      public void focusGained(FocusEvent e) {}
    });
View Full Code Here

    this.createNextTermCombo();

    this.add(this.termRowsPanel);

    // FocusListener
    final FocusListener FL = new FocusListener() {
      @Override
      public void focusGained(final FocusEvent arg0) {
        if (UnitermOperatorPanel.this.visualRifEditor.getDocumentContainer().getActiveDocument()
            .getDocumentEditorPane().getPrefixList().length > 0) {
View Full Code Here

    }

    this.add(this.termRowsPanel);

    // FocusListener
    final FocusListener FL = new FocusListener() {
      @Override
      public void focusGained(final FocusEvent arg0) {
        if (FrameOperatorPanel.this.visualRifEditor.getDocumentContainer().getActiveDocument()
            .getDocumentEditorPane().getPrefixList().length > 0) {
          FrameOperatorPanel.this.frameOperator.savePrefixes();
View Full Code Here

TOP

Related Classes of java.awt.event.FocusListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.