コード例 #1
0
ファイル: AddFriendsSheet.java プロジェクト: coltnz/robonobo
 public AddFriendsSheet(RobonoboFrame frame) {
   super(frame);
   setPreferredSize(size);
   double[][] cellSizen = {{10, 90, 5, 250, 10}, {10, 25, 10, 30, 10, 25, 10, 30, 10}};
   setLayout(new TableLayout(cellSizen));
   setName("playback.background.panel");
   RLabel titleLbl = new RLabel16B("Add friends");
   add(titleLbl, "1,1,3,1");
   JPanel blurb =
       new LineBreakTextPanel(
           "Enter your friends' email addresses below to invite them to robonobo:",
           RoboFont.getFont(13, false),
           345);
   add(blurb, "1,3,3,3");
   RLabel newFriendLbl = new RLabel12("New friends:");
   add(newFriendLbl, "1,5");
   emailField = new RTextField(DEFAULT_EMAILS);
   emailField.addKeyListener(
       new KeyAdapter() {
         public void keyReleased(KeyEvent e) {
           shareBtn.setEnabled(targetSelected());
         }
       });
   emailField.addMouseListener(
       new MouseAdapter() {
         public void mouseClicked(MouseEvent e) {
           if (emailField.getText().equals(DEFAULT_EMAILS)) emailField.setText("");
         }
       });
   add(emailField, "3,5");
   add(new ButtonPanel(), "3,7,r,t");
 }
コード例 #2
0
ファイル: AddFriendsSheet.java プロジェクト: coltnz/robonobo
 private boolean targetSelected() {
   // Could bugger about with regexes here, but I don't think it's worth it
   return (emailField.getText().length() > 0 && !emailField.getText().equals(DEFAULT_EMAILS));
 }
コード例 #3
0
ファイル: AddFriendsSheet.java プロジェクト: coltnz/robonobo
 @Override
 public void onShow() {
   emailField.requestFocusInWindow();
   emailField.selectAll();
 }