public AnagramTopComponent() {
   wordLibrary = WordLibrary.getDefault();
   initComponents();
   scrambledWord.setText(wordLibrary.getScrambledWord(wordIdx));
   setName(NbBundle.getMessage(AnagramTopComponent.class, "CTL_AnagramTopComponent"));
   setToolTipText(NbBundle.getMessage(AnagramTopComponent.class, "HINT_AnagramTopComponent"));
 }
示例#2
0
  /** Creates new form Anagrams */
  public Anagrams() {
    wordLibrary = WordLibrary.getDefault();

    initComponents();
    getRootPane().setDefaultButton(guessButton);
    scrambledWord.setText(wordLibrary.getScrambledWord(wordIdx));
    pack();
    guessedWord.requestFocusInWindow();
    // Center in the screen
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    setLocation(
        new Point(
            (screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.width) / 2));
  }