We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
Excuse me, I contact you because I start to use processing but I need your help.
In fact I have 2 tab, and I want to create a tab or something like that who is before these two other tabs where we have to enter an username and a password, if password ok, you « switch » on the other tab and you can do what you want, if the password is wrong, you can’t access once the password is not good.. :/
Is it possible to do something like that or not?
I see that someone do that
import java.awt.*;
import java.awt.event.*;
void setup(){ size(600, 600); Label l1 = new Label("Enter Username"),
l2 = new Label("Enter password");
TextField t1 = new TextField("",45), t2 = new TextField(20);
t2.setEchoChar('*');
add(l1);
add(t1);
add(l2);
add(t2);
}
i don’t know if it can help you..
Sincerely, Alexis.
Answers
A simple example of using text dialog inputs:
Hello, thank you for your help but now I have some problem. First processing tell me "No library found for static javax.swing.JOptionPane" So I don't know if I have to download it or something like that :/
And now I want to enter a password, so how can I hide the text with "*" ? :/ Thank you again..
It's just a glitch! Otherwise, we wouldn't be able to use its methods & fields like showInputDialog() or ERROR_MESSAGE! :-j
I've had to search for it and found this 1 out:
http://www.coderanch.com/t/341807/GUI/java/JOptionPane-password-input
Their fix is intermingle JOptionPane + JPasswordField!
And below's my own take on it: <:-P
Extra reference links: :-c
http://processing.org/reference/StringDict.html
http://docs.oracle.com/javase/7/docs/api/javax/swing/JOptionPane.html
http://docs.oracle.com/javase/7/docs/api/javax/swing/JPasswordField.html
Oh okay :p but....thank you very much, it works a charm! ^:)^ Sorry for my english because I'm french, but it's just perfect! Exactly what I want, thank you again! :)
Hello,
We are making a game for school and we've tried to implement this code into our code so that the popup screen would popup when you clicked on a certain position on the background. However, this did not work. it gave us the error that we missed a semi colon wich made us very confused cause if we used this code seperatly it did work perfectly fine. can you help us ?
Post your Code