Package tcup

Source Code of tcup.TcupGUI

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tcup;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import twitter4j.*;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import twitter4j.conf.ConfigurationBuilder;
/**
*
* @author Nate
*/
public class TcupGUI extends javax.swing.JFrame {

    public  Twitter twitter;
    public TwitterStream twitterStream;
    public ConfigurationBuilder cbt,cb;
    public TwitterFactory tf;
    private int rtcounter;
    /**
     * Creates new form TcupGUI
     */
    public TcupGUI() {
        rtcounter =0;
        initComponents();
        this.getHomefeed();
     //   initme();
    // The factory instance is re-useable and thread safe.
   cb = new ConfigurationBuilder();
       cb.setDebugEnabled(true)
  .setOAuthConsumerKey("T9R9neSG8AbXdATo4oEQ")
  .setOAuthConsumerSecret("SYfV5kBafR2aqTjBomhsFay873tChhufe72fR3Y")
  .setOAuthAccessToken("173202720-cMns7Qe8fw4spWOqO6hD8K1ZLWudlSdJQLttSLKi")
  .setOAuthAccessTokenSecret("Nqhxopd7UJB1sgYXet1E1efCC0D28FlT3vG3S7e19I");
      
     cbt = new ConfigurationBuilder();
       cb.setDebugEnabled(true)
  .setOAuthConsumerKey("T9R9neSG8AbXdATo4oEQ")
  .setOAuthConsumerSecret("SYfV5kBafR2aqTjBomhsFay873tChhufe72fR3Y")
  .setOAuthAccessToken("173202720-cMns7Qe8fw4spWOqO6hD8K1ZLWudlSdJQLttSLKi")
  .setOAuthAccessTokenSecret("Nqhxopd7UJB1sgYXet1E1efCC0D28FlT3vG3S7e19I");
      
       tf = new TwitterFactory(cbt.build());
       twitter = tf.getInstance();
  
    twitterStream = new TwitterStreamFactory(cb.build()).getInstance();
        twitterStream.addListener(listener);
        // user() method internally creates a thread which manipulates TwitterStream and calls these adequate listener methods continuously.
        twitterStream.user();
        try {
            this.tName.setText(twitterStream.getScreenName());
        } catch (TwitterException ex) {
            Logger.getLogger(TcupGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
           
            cb = new ConfigurationBuilder();
       cb.setDebugEnabled(true)
  .setOAuthConsumerKey("T9R9neSG8AbXdATo4oEQ")
  .setOAuthConsumerSecret("SYfV5kBafR2aqTjBomhsFay873tChhufe72fR3Y")
  .setOAuthAccessToken("173202720-cMns7Qe8fw4spWOqO6hD8K1ZLWudlSdJQLttSLKi")
  .setOAuthAccessTokenSecret("Nqhxopd7UJB1sgYXet1E1efCC0D28FlT3vG3S7e19I");
       tf = new TwitterFactory(cb.build());
       twitter = tf.getInstance();
            this.currentStatus.setText(twitter.verifyCredentials().getStatus().getText().toString());
            User user = twitter.showUser(twitter.getId());
            URL url = user.getProfileImageURL();
            ImageIcon img = new ImageIcon(url);
            this.userImage.setIcon(img);
           
        } catch (TwitterException ex) {
            Logger.getLogger(TcupGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

  
   
    /**
     * 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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        taMessage = new javax.swing.JTextArea();
        tName = new javax.swing.JLabel();
        tLength = new javax.swing.JLabel();
        bTweet = new javax.swing.JButton();
        Stream = new javax.swing.JTabbedPane();
        userStream = new javax.swing.JPanel();
        usi1 = new javax.swing.JLabel();
        usm1 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        usi2 = new javax.swing.JLabel();
        usm2 = new javax.swing.JLabel();
        rtStream = new javax.swing.JPanel();
        rti1 = new javax.swing.JLabel();
        rtm1 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        rti2 = new javax.swing.JLabel();
        rtm2 = new javax.swing.JLabel();
        currentStatus = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        userImage = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        taMessage.setColumns(20);
        taMessage.setLineWrap(true);
        taMessage.setRows(5);
        taMessage.setAutoscrolls(false);
        taMessage.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                taMessageKeyTyped(evt);
            }
        });
        jScrollPane1.setViewportView(taMessage);

        tName.setText("jLabel1");

        bTweet.setText("Tweet");
        bTweet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTweetActionPerformed(evt);
            }
        });

        Stream.setBorder(new javax.swing.border.MatteBorder(null));

        javax.swing.GroupLayout userStreamLayout = new javax.swing.GroupLayout(userStream);
        userStream.setLayout(userStreamLayout);
        userStreamLayout.setHorizontalGroup(
            userStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator2)
            .addGroup(userStreamLayout.createSequentialGroup()
                .addGroup(userStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(usi1)
                    .addComponent(usm1)
                    .addComponent(usi2)
                    .addComponent(usm2))
                .addGap(0, 223, Short.MAX_VALUE))
        );
        userStreamLayout.setVerticalGroup(
            userStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(userStreamLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(usi1)
                .addGap(42, 42, 42)
                .addComponent(usm1)
                .addGap(18, 18, 18)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(usi2)
                .addGap(18, 18, 18)
                .addComponent(usm2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(251, 251, 251))
        );

        Stream.addTab("User Stream", userStream);

        javax.swing.GroupLayout rtStreamLayout = new javax.swing.GroupLayout(rtStream);
        rtStream.setLayout(rtStreamLayout);
        rtStreamLayout.setHorizontalGroup(
            rtStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1)
            .addGroup(rtStreamLayout.createSequentialGroup()
                .addGroup(rtStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rti1)
                    .addComponent(rti2)
                    .addComponent(rtm2)
                    .addComponent(rtm1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 29, Short.MAX_VALUE))
        );
        rtStreamLayout.setVerticalGroup(
            rtStreamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(rtStreamLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rti1)
                .addGap(18, 18, 18)
                .addComponent(rtm1)
                .addGap(68, 68, 68)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rti2)
                .addGap(38, 38, 38)
                .addComponent(rtm2)
                .addContainerGap(210, Short.MAX_VALUE))
        );

        Stream.addTab("Real Time", rtStream);

        currentStatus.setText("jLabel1");

        jLabel1.setText("Current Status");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(currentStatus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tLength, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(userImage, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(tName))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(bTweet)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addComponent(Stream)
                .addGap(36, 36, 36))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(userImage, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tName))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(bTweet)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jLabel1)))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(tLength, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(currentStatus)))
                        .addGap(110, 110, 110))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(Stream, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addContainerGap())))
        );

        Stream.getAccessibleContext().setAccessibleName("Stream");

        jTabbedPane1.addTab("Twitter", jPanel1);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 601, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 415, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Facebook", jPanel2);

        jMenu1.setText("File");

        jMenuItem1.setText("Quit");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void taMessageKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_taMessageKeyTyped
        this.tLength.setText(""+this.taMessage.getText().length()+"");
    }//GEN-LAST:event_taMessageKeyTyped

    private void bTweetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bTweetActionPerformed
        if(this.taMessage.getText().length() > 140)
        {
            final JPanel panel = new JPanel();
            JOptionPane.showMessageDialog(panel,"Message was too long!");
            return;
        }
        else if(this.taMessage.getText().isEmpty())
        {
            final JPanel panel = new JPanel();
            JOptionPane.showMessageDialog(panel,"Message was empty!");
            return;
        }
        postTweet(this.taMessage.getText());
        this.taMessage.setText("");
    }//GEN-LAST:event_bTweetActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
      System.exit(0);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void postTweet(String tweet)
    {
        try {
             cb = new ConfigurationBuilder();
       cb.setDebugEnabled(true)
  .setOAuthConsumerKey("T9R9neSG8AbXdATo4oEQ")
  .setOAuthConsumerSecret("SYfV5kBafR2aqTjBomhsFay873tChhufe72fR3Y")
  .setOAuthAccessToken("173202720-cMns7Qe8fw4spWOqO6hD8K1ZLWudlSdJQLttSLKi")
  .setOAuthAccessTokenSecret("Nqhxopd7UJB1sgYXet1E1efCC0D28FlT3vG3S7e19I");
       tf = new TwitterFactory(cb.build());
       
       twitter = tf.getInstance();
            Status status = twitter.updateStatus(tweet);
            this.currentStatus.setText(status.getText());
        } catch (TwitterException ex) {
            Logger.getLogger(TcupGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }
   
    private void getHomefeed()
    {
      try {
             cb = new ConfigurationBuilder();
       cb.setDebugEnabled(true)
  .setOAuthConsumerKey("T9R9neSG8AbXdATo4oEQ")
  .setOAuthConsumerSecret("SYfV5kBafR2aqTjBomhsFay873tChhufe72fR3Y")
  .setOAuthAccessToken("173202720-cMns7Qe8fw4spWOqO6hD8K1ZLWudlSdJQLttSLKi")
  .setOAuthAccessTokenSecret("Nqhxopd7UJB1sgYXet1E1efCC0D28FlT3vG3S7e19I");
       tf = new TwitterFactory(cb.build());
       
       twitter = tf.getInstance();
        User user = twitter.verifyCredentials();
            List<Status> statuses = twitter.getHomeTimeline();
            int mid = 0;
           
            for (Status status : statuses) {
                //System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
                switch(mid%2)
                {
                    case 0:
                    {
                        User user2 = status.getUser();
                        URL url = user2.getProfileImageURL();
                        ImageIcon img = new ImageIcon(url);
                        usi1.setIcon(img);
                        usi1.setText("@"+status.getUser().getScreenName());
                        usm1.setText("<html> - " + status.getText()+"</html>");
                        mid++;
                    }break;
                       
                    default:
                    {
                        User user2 = status.getUser();
                        URL url = user2.getProfileImageURL();
                        ImageIcon img = new ImageIcon(url);
                        usi2.setIcon(img);
                        usi2.setText("@"+status.getUser().getScreenName());
                        usm2.setText("<html> - " + status.getText()+"</html>");
                        mid = 0;
                    }break;
                }
              
            }
      }
       catch (TwitterException ex) {
            Logger.getLogger(TcupGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        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(TcupGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TcupGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TcupGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TcupGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new TcupGUI().setVisible(true);
            }
        });
    }
   
     UserStreamListener listener = new UserStreamListener() {
        public void onStatus(Status status) {
            int def = rtcounter%2;
            switch(def)
            {
                case 0:
                {
                    User user = status.getUser();
                    URL url = user.getProfileImageURL();
                    ImageIcon img = new ImageIcon(url);
                    rti1.setIcon(img);
                    rti1.setText("@"+status.getUser().getScreenName());
                    rtm1.setText("<html> - " + status.getText()+"</html>");
                    rtcounter++;
                }break;
                default:
                {
                  
                    User user = status.getUser();
                    URL url = user.getProfileImageURL();
                    ImageIcon img = new ImageIcon(url);
                    rti2.setIcon(img);
                    rti2.setText("@"+status.getUser().getScreenName());
                    rtm2.setText("<html> - " + status.getText()+"</html>");
                    rtcounter = 0;
                }break;
                   
            }
            System.out.println("onStatus @" + status.getUser().getScreenName() + " - " + status.getText());
        }

        public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {
            System.out.println("Got a status deletion notice id:" + statusDeletionNotice.getStatusId());
        }

        public void onDeletionNotice(long directMessageId, long userId) {
            System.out.println("Got a direct message deletion notice id:" + directMessageId);
        }

        public void onTrackLimitationNotice(int numberOfLimitedStatuses) {
            System.out.println("Got a track limitation notice:" + numberOfLimitedStatuses);
        }

        public void onScrubGeo(long userId, long upToStatusId) {
            System.out.println("Got scrub_geo event userId:" + userId + " upToStatusId:" + upToStatusId);
        }

        public void onFriendList(long[] friendIds) {
            System.out.print("onFriendList");
            for (long friendId : friendIds) {
                System.out.print(" " + friendId);
            }
            System.out.println();
        }

        public void onFavorite(User source, User target, Status favoritedStatus) {
            System.out.println("onFavorite source:@"
                    + source.getScreenName() + " target:@"
                    + target.getScreenName() + " @"
                    + favoritedStatus.getUser().getScreenName() + " - "
                    + favoritedStatus.getText());
        }

        public void onUnfavorite(User source, User target, Status unfavoritedStatus) {
            System.out.println("onUnFavorite source:@"
                    + source.getScreenName() + " target:@"
                    + target.getScreenName() + " @"
                    + unfavoritedStatus.getUser().getScreenName()
                    + " - " + unfavoritedStatus.getText());
        }

        public void onFollow(User source, User followedUser) {
            System.out.println("onFollow source:@"
                    + source.getScreenName() + " target:@"
                    + followedUser.getScreenName());
        }

        public void onRetweet(User source, User target, Status retweetedStatus) {
            System.out.println("onRetweet @"
                    + retweetedStatus.getUser().getScreenName() + " - "
                    + retweetedStatus.getText());
        }

        public void onDirectMessage(DirectMessage directMessage) {
            System.out.println("onDirectMessage text:"
                    + directMessage.getText());
        }

        public void onUserListMemberAddition(User addedMember, User listOwner, UserList list) {
            System.out.println("onUserListMemberAddition added member:@"
                    + addedMember.getScreenName()
                    + " listOwner:@" + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListMemberDeletion(User deletedMember, User listOwner, UserList list) {
            System.out.println("onUserListMemberDeleted deleted member:@"
                    + deletedMember.getScreenName()
                    + " listOwner:@" + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListSubscription(User subscriber, User listOwner, UserList list) {
            System.out.println("onUserListSubscribed subscriber:@"
                    + subscriber.getScreenName()
                    + " listOwner:@" + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListUnsubscription(User subscriber, User listOwner, UserList list) {
            System.out.println("onUserListUnsubscribed subscriber:@"
                    + subscriber.getScreenName()
                    + " listOwner:@" + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListCreation(User listOwner, UserList list) {
            System.out.println("onUserListCreated  listOwner:@"
                    + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListUpdate(User listOwner, UserList list) {
            System.out.println("onUserListUpdated  listOwner:@"
                    + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserListDeletion(User listOwner, UserList list) {
            System.out.println("onUserListDestroyed  listOwner:@"
                    + listOwner.getScreenName()
                    + " list:" + list.getName());
        }

        public void onUserProfileUpdate(User updatedUser) {
            System.out.println("onUserProfileUpdated user:@" + updatedUser.getScreenName());
        }

        public void onBlock(User source, User blockedUser) {
            System.out.println("onBlock source:@" + source.getScreenName()
                    + " target:@" + blockedUser.getScreenName());
        }

        public void onUnblock(User source, User unblockedUser) {
            System.out.println("onUnblock source:@" + source.getScreenName()
                    + " target:@" + unblockedUser.getScreenName());
        }

        public void onException(Exception ex) {
            ex.printStackTrace();
            System.out.println("onException:" + ex.getMessage());
        }
    }; //*/
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane Stream;
    private javax.swing.JButton bTweet;
    private javax.swing.JLabel currentStatus;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel rtStream;
    private javax.swing.JLabel rti1;
    private javax.swing.JLabel rti2;
    private javax.swing.JLabel rtm1;
    private javax.swing.JLabel rtm2;
    private javax.swing.JLabel tLength;
    private javax.swing.JLabel tName;
    private javax.swing.JTextArea taMessage;
    private javax.swing.JLabel userImage;
    private javax.swing.JPanel userStream;
    private javax.swing.JLabel usi1;
    private javax.swing.JLabel usi2;
    private javax.swing.JLabel usm1;
    private javax.swing.JLabel usm2;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of tcup.TcupGUI

TOP
Copyright © 2018 www.massapi.com. 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.