Click here to Skip to main content
12,697,076 members (24,881 online)
   

Java

 
GeneralRe: android app Pin
StudentGirl5-Mar-13 5:03
memberStudentGirl5-Mar-13 5:03 
QuestionHow to manipulate a combo box? Pin
Member 98295362-Mar-13 0:28
memberMember 98295362-Mar-13 0:28 
AnswerRe: How to manipulate a combo box? Pin
Richard MacCutchan2-Mar-13 0:59
mvpRichard MacCutchan2-Mar-13 0:59 
QuestionImage Mosaicing Pin
rachit1328-Feb-13 20:03
memberrachit1328-Feb-13 20:03 
QuestionCan we have Scala added to the list? Pin
dusty_dex26-Feb-13 7:48
memberdusty_dex26-Feb-13 7:48 
AnswerRe: Can we have Scala added to the list? Pin
jschell26-Feb-13 10:04
memberjschell26-Feb-13 10:04 
GeneralRe: Can we have Scala added to the list? Pin
dusty_dex26-Feb-13 10:42
memberdusty_dex26-Feb-13 10:42 
Questionchoise of framework for end of study Pin
simontifo25-Feb-13 3:33
membersimontifo25-Feb-13 3:33 
AnswerRe: choise of framework for end of study Pin
Prasad Khandekar2-May-13 21:15
professionalPrasad Khandekar2-May-13 21:15 
Questioncompiler Pin
Olfat Ameen23-Feb-13 18:56
memberOlfat Ameen23-Feb-13 18:56 
AnswerRe: compiler Pin
Richard MacCutchan23-Feb-13 22:18
mvpRichard MacCutchan23-Feb-13 22:18 
QuestionJava Pin
thevivek.pro21-Feb-13 20:42
memberthevivek.pro21-Feb-13 20:42 
AnswerRe: Java Pin
Marco Bertschi21-Feb-13 23:08
memberMarco Bertschi21-Feb-13 23:08 
Questionproblem with looping Pin
Member 982953620-Feb-13 23:20
memberMember 982953620-Feb-13 23:20 
Hello everyone! I'm currently having a problem with my program it doesn't loop properly please help me with it. The code is below. Thanks in advance!

import java.util.Scanner;
import javax.swing.JOptionPane;
import javax.swing.*;
    public class Wewe{
        public static void main(String[]args){
            Scanner inp = new Scanner(System.in);
            boolean tryAgain;
            do{
            System.out.print("\nInput username: ");
            String user = inp.nextLine();
            System.out.print("\nInput password: ");
            String pass = inp.nextLine();
        if(user.equals("admin") && pass.equals("admin")){
                System.out.print("Success!");
                tryAgain = true;
            }
            if(user!="admin" && pass!="admin"){
                JOptionPane.showMessageDialog(null, "Try again! Invalid username or password!","Error Logging-In", JOptionPane.ERROR_MESSAGE);
            tryAgain = false;
        }
    }while(tryAgain = true);
            }
        }


What I want to happen is that once the user entered wrong username or password the program will then loop. But if the user entered the correct username or password, it wont loop asking the user for the correct one.
AnswerRe: problem with looping Pin
Richard MacCutchan20-Feb-13 23:56
mvpRichard MacCutchan20-Feb-13 23:56 
AnswerRe: problem with looping Pin
ameymh21-Feb-13 19:59
memberameymh21-Feb-13 19:59 
GeneralRe: problem with looping Pin
Richard MacCutchan21-Feb-13 23:35
mvpRichard MacCutchan21-Feb-13 23:35 
SuggestionRe: problem with looping Pin
SENTHILKANTH26-Feb-13 2:44
memberSENTHILKANTH26-Feb-13 2:44 
QuestionCalendar Recommendations Pin
FyreWyrm16-Feb-13 6:45
memberFyreWyrm16-Feb-13 6:45 
AnswerRe: Calendar Recommendations Pin
Prasad Khandekar2-May-13 21:20
professionalPrasad Khandekar2-May-13 21:20 
QuestionJava convert Image to unsigned char [][] Pin
chor_savorn12-Feb-13 21:44
groupchor_savorn12-Feb-13 21:44 
AnswerRe: Java convert Image to unsigned char [][] Pin
Richard MacCutchan12-Feb-13 23:26
mvpRichard MacCutchan12-Feb-13 23:26 
GeneralRe: Java convert Image to unsigned char [][] Pin
chor_savorn4-Mar-13 0:07
groupchor_savorn4-Mar-13 0:07 
GeneralRe: Java convert Image to unsigned char [][] Pin
Richard MacCutchan4-Mar-13 0:18
mvpRichard MacCutchan4-Mar-13 0:18 
GeneralRe: Java convert Image to unsigned char [][] Pin
chor_savorn4-Mar-13 15:36
groupchor_savorn4-Mar-13 15:36 
GeneralRe: Java convert Image to unsigned char [][] Pin
Richard MacCutchan4-Mar-13 23:52
mvpRichard MacCutchan4-Mar-13 23:52 
GeneralRe: Java convert Image to unsigned char [][] Pin
chor_savorn5-Mar-13 23:09
groupchor_savorn5-Mar-13 23:09 
GeneralRe: Java convert Image to unsigned char [][] Pin
Richard MacCutchan5-Mar-13 23:21
mvpRichard MacCutchan5-Mar-13 23:21 
GeneralRe: Java convert Image to unsigned char [][] Pin
chor_savorn5-Mar-13 23:40
groupchor_savorn5-Mar-13 23:40 
GeneralRe: Java convert Image to unsigned char [][] Pin
Richard MacCutchan6-Mar-13 0:35
mvpRichard MacCutchan6-Mar-13 0:35 
QuestionMS Doc in Java Pin
Thirunavukkarasu Dhanushkodi11-Feb-13 5:55
memberThirunavukkarasu Dhanushkodi11-Feb-13 5:55 
AnswerRe: MS Doc in Java Pin
Richard MacCutchan11-Feb-13 6:08
mvpRichard MacCutchan11-Feb-13 6:08 
GeneralRe: MS Doc in Java Pin
Thirunavukkarasu Dhanushkodi11-Feb-13 6:13
memberThirunavukkarasu Dhanushkodi11-Feb-13 6:13 
AnswerRe: MS Doc in Java Pin
TorstenH.14-Feb-13 5:03
memberTorstenH.14-Feb-13 5:03 
QuestionJDBC Pin
Thirunavukkarasu Dhanushkodi9-Feb-13 19:09
memberThirunavukkarasu Dhanushkodi9-Feb-13 19:09 
AnswerRe: JDBC Pin
Richard MacCutchan9-Feb-13 22:38
mvpRichard MacCutchan9-Feb-13 22:38 
AnswerRe: JDBC Pin
Thirunavukkarasu Dhanushkodi11-Feb-13 5:53
memberThirunavukkarasu Dhanushkodi11-Feb-13 5:53 
Questionimage and video trapping using with mobile camera in java and j2me language code Pin
anand pal8-Feb-13 21:44
memberanand pal8-Feb-13 21:44 
AnswerRe: image and video trapping using with mobile camera in java and j2me language code Pin
Richard MacCutchan9-Feb-13 0:07
mvpRichard MacCutchan9-Feb-13 0:07 
QuestionHelp me to fix my codes in Java Pin
mobi358-Feb-13 5:47
membermobi358-Feb-13 5:47 
AnswerRe: Help me to fix my codes in Java Pin
Richard MacCutchan8-Feb-13 6:36
mvpRichard MacCutchan8-Feb-13 6:36 
GeneralRe: Help me to fix my codes in Java Pin
mobi358-Feb-13 13:13
membermobi358-Feb-13 13:13 
GeneralRe: Help me to fix my codes in Java Pin
Richard MacCutchan8-Feb-13 23:27
mvpRichard MacCutchan8-Feb-13 23:27 
AnswerRe: Help me to fix my codes in Java Pin
SENTHILKANTH26-Feb-13 2:49
memberSENTHILKANTH26-Feb-13 2:49 
Questionplease help Pin
OmarSH7-Feb-13 3:41
memberOmarSH7-Feb-13 3:41 
Answersolution for your problem Pin
venky00287-Feb-13 4:10
membervenky00287-Feb-13 4:10 
GeneralRe: your solution didnt work Pin
OmarSH7-Feb-13 8:55
memberOmarSH7-Feb-13 8:55 
AnswerRe: please help Pin
jschell7-Feb-13 11:03
memberjschell7-Feb-13 11:03 
GeneralRe: please help Pin
OmarSH7-Feb-13 12:00
memberOmarSH7-Feb-13 12:00 
GeneralRe: please help Pin
Richard MacCutchan8-Feb-13 0:12
mvpRichard MacCutchan8-Feb-13 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 18 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid