Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on login frame in java.  RSS feed

 
Vivek Phogat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me? I need to enable login in following frame with username and password. I'm providing my code as.



Login.jpg
[Thumbnail for Login.jpg]
 
Mohamed Sanaulla
Bartender
Posts: 3169
34
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Please TellTheDetails UseCodeTags
 
Vivek Phogat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:Welcome to JavaRanch!

Please TellTheDetails UseCodeTags








Which type of details.you need .
I .ve already given code and now i just want to set username and password in two fields. and i also want to enable login on basis of information of username n password.....
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch Vivek.
When you post code, please use code tags
I have edited your existing post to add the code tags. As you can see it makes the code much more readable and easier to understand

Click this link for details => UseCodeTags
 
Mohamed Sanaulla
Bartender
Posts: 3169
34
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For password you have Password specific field- JPasswordField.
So for the event handler for Login action- You get both the username and the password from their respective fields. And then compare them with the correct values. If it doesn't match you can ask the user to reenter the details.

Now the concern would be to show different UI Screens- One would be for Successful login. For this you can either use a LayoutManager (CardLayout) and then keep setting the relevant component in the layout as Visible.

Other way would be to use a JDesktopPane and then add multiple JInternalFrame to it. So you set the visibility to false for all the Internal frames and then keeping setting respective internal frames as visible.
 
Vivek Phogat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:For password you have Password specific field- JPasswordField.
So for the event handler for Login action- You get both the username and the password from their respective fields. And then compare them with the correct values. If it doesn't match you can ask the user to reenter the details.

Now the concern would be to show different UI Screens- One would be for Successful login. For this you can either use a LayoutManager (CardLayout) and then keep setting the relevant component in the layout as Visible.

Other way would be to use a JDesktopPane and then add multiple JInternalFrame to it. So you set the visibility to false for all the Internal frames and then keeping setting respective internal frames as visible.


Vivek phogat wrote: Thanks Sir, That was my very first post on javaranch .com So sorry also
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!