Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to authenticate user in swing application from twitter ?

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to authenticate user in swing application from twitter ?

    public String getUserName() {
             return textName.getText();
         }
     
         public String getPassword() {
             return String.valueOf(passField.getPassword());
         }
    	 public static void main(String[] args) throws TwitterException{
             Login lg = new Login();
     
         }
    	 public void acc(){
    	 try{
    		 Login lg = new Login();
    		 String userName = lg.getUserName();
             String password = lg.getPassword();
     
             Twitter twitter = new Twitter("username", "password");
             twitter.verifyCredentials();
             JOptionPane.showMessageDialog(null, "Login successful!");
         } catch(TwitterException e){
             JOptionPane.showMessageDialog(null, "Unable to login");
         }
    }
    // this code is unable to authenticate user it always give login failed...please help me..!!
    Last edited by jps; September 13th, 2013 at 09:32 AM. Reason: code tags


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,065
    My Mood
    Mellow
    Thanks
    243
    Thanked 750 Times in 736 Posts

    Default Re: how to authenticate user in swing application from twitter ?

    Please post your code in code tags. Refer to this page for instructions.

    You don't show the code necessary to diagnose your problem, but I suspect your verification method is comparing the equality of two String objects using the '==' operator. Use the equals() method instead.
    Last edited by jps; September 13th, 2013 at 09:31 AM. Reason: added link

Similar Threads

  1. Thread dysfunctioning in swing application
    By rpathak123 in forum Threads
    Replies: 0
    Last Post: April 4th, 2013, 05:19 AM
  2. Replies: 1
    Last Post: January 6th, 2013, 12:06 PM
  3. A date picker in my swing application.
    By Petsoft in forum AWT / Java Swing
    Replies: 1
    Last Post: November 7th, 2012, 09:39 AM
  4. JSP / Java Problem - Twitter search application
    By aidanmur in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 30th, 2012, 03:17 PM
  5. How to authenticate user using oracle JAZN.xml
    By rajnish.rathi in forum Member Introductions
    Replies: 1
    Last Post: June 14th, 2011, 09:19 AM