Click here to Skip to main content
       

Java

 
GeneralRe: android app PinmemberStudentGirl5-Mar-13 4:03 
QuestionHow to manipulate a combo box? PinmemberMember 98295361-Mar-13 23:28 
AnswerRe: How to manipulate a combo box? PinmvpRichard MacCutchan1-Mar-13 23:59 
QuestionImage Mosaicing Pinmemberrachit1328-Feb-13 19:03 
QuestionCan we have Scala added to the list? Pinmemberdusty_dex26-Feb-13 6:48 
AnswerRe: Can we have Scala added to the list? Pinmemberjschell26-Feb-13 9:04 
GeneralRe: Can we have Scala added to the list? Pinmemberdusty_dex26-Feb-13 9:42 
Questionchoise of framework for end of study Pinmembersimontifo25-Feb-13 2:33 
AnswerRe: choise of framework for end of study PinprofessionalPrasad Khandekar2-May-13 20:15 
Questioncompiler PinmemberOlfat Ameen23-Feb-13 17:56 
AnswerRe: compiler PinmvpRichard MacCutchan23-Feb-13 21:18 
QuestionJava Pinmemberthevivek.pro21-Feb-13 19:42 
AnswerRe: Java PinmemberMarco Bertschi21-Feb-13 22:08 
Questionproblem with looping PinmemberMember 982953620-Feb-13 22: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 PinmvpRichard MacCutchan20-Feb-13 22:56 
AnswerRe: problem with looping Pinmemberameymh21-Feb-13 18:59 
GeneralRe: problem with looping PinmvpRichard MacCutchan21-Feb-13 22:35 
SuggestionRe: problem with looping PinmemberSENTHILKANTH26-Feb-13 1:44 
QuestionCalendar Recommendations PinmemberFyreWyrm16-Feb-13 5:45 
AnswerRe: Calendar Recommendations PinprofessionalPrasad Khandekar2-May-13 20:20 
QuestionJava convert Image to unsigned char [][] Pingroupchor_savorn12-Feb-13 20:44 
AnswerRe: Java convert Image to unsigned char [][] PinmvpRichard MacCutchan12-Feb-13 22:26 
GeneralRe: Java convert Image to unsigned char [][] Pingroupchor_savorn3-Mar-13 23:07 
GeneralRe: Java convert Image to unsigned char [][] PinmvpRichard MacCutchan3-Mar-13 23:18 
GeneralRe: Java convert Image to unsigned char [][] Pingroupchor_savorn4-Mar-13 14:36 
GeneralRe: Java convert Image to unsigned char [][] PinmvpRichard MacCutchan4-Mar-13 22:52 
GeneralRe: Java convert Image to unsigned char [][] Pingroupchor_savorn5-Mar-13 22:09 
GeneralRe: Java convert Image to unsigned char [][] PinmvpRichard MacCutchan5-Mar-13 22:21 
GeneralRe: Java convert Image to unsigned char [][] Pingroupchor_savorn5-Mar-13 22:40 
GeneralRe: Java convert Image to unsigned char [][] PinmvpRichard MacCutchan5-Mar-13 23:35 
QuestionMS Doc in Java PinmemberThirunavukkarasu Dhanushkodi11-Feb-13 4:55 
AnswerRe: MS Doc in Java PinmvpRichard MacCutchan11-Feb-13 5:08 
GeneralRe: MS Doc in Java PinmemberThirunavukkarasu Dhanushkodi11-Feb-13 5:13 
AnswerRe: MS Doc in Java PinmemberTorstenH.14-Feb-13 4:03 
QuestionJDBC PinmemberThirunavukkarasu Dhanushkodi9-Feb-13 18:09 
AnswerRe: JDBC PinmvpRichard MacCutchan9-Feb-13 21:38 
AnswerRe: JDBC PinmemberThirunavukkarasu Dhanushkodi11-Feb-13 4:53 
Questionimage and video trapping using with mobile camera in java and j2me language code Pinmemberanand pal8-Feb-13 20:44 
AnswerRe: image and video trapping using with mobile camera in java and j2me language code PinmvpRichard MacCutchan8-Feb-13 23:07 
QuestionHelp me to fix my codes in Java Pinmembermobi358-Feb-13 4:47 
AnswerRe: Help me to fix my codes in Java PinmvpRichard MacCutchan8-Feb-13 5:36 
GeneralRe: Help me to fix my codes in Java Pinmembermobi358-Feb-13 12:13 
GeneralRe: Help me to fix my codes in Java PinmvpRichard MacCutchan8-Feb-13 22:27 
AnswerRe: Help me to fix my codes in Java PinmemberSENTHILKANTH26-Feb-13 1:49 
Questionplease help PinmemberOmarSH7-Feb-13 2:41 
Answersolution for your problem Pinmembervenky00287-Feb-13 3:10 
GeneralRe: your solution didnt work [modified] PinmemberOmarSH7-Feb-13 7:55 
AnswerRe: please help Pinmemberjschell7-Feb-13 10:03 
GeneralRe: please help PinmemberOmarSH7-Feb-13 11:00 
GeneralRe: please help PinmvpRichard MacCutchan7-Feb-13 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web01 | 2.8.140721.1 | Last Updated 1 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid