|
-
Oct 21st, 2006, 06:16 AM
#1
Thread Starter
Hyperactive Member
password if condition
hi all.
I am new to java and i want to make a message text box asking for the pass word. if the password is correct then messagebox title and text = welcome else = access denied
this is what i have put together myself but it doesn't work..
Code:
import javax.swing.JOptionPane;
public class Password
{
public static void main(String args[])
{
String name =
JOptionPane.showInputDialog("Password?");
if:
{
raw_input = "hello";
String message =
String.format("Welcome");
JOptionPane.showMessageDialog("Welcome");
}
else:
{
String message =
String.format("Access Denied");
JOptionPane.showMessageDialog("Access Denied")
}
}
}
If my post has been helpful, please rate it! 
-
Oct 21st, 2006, 07:42 AM
#2
Re: password if condition
Perhaps you should find out how if and else really work. I recommend a tutorial or beginner's book.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 21st, 2006, 05:20 PM
#3
Re: password if condition
Just like CornedBee said, you won't learn much by only asking questions. Learning from a book is the best way
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|