aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Need help on login frame in java. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Need help on login frame in java." Watch "Need help on login frame in java." New topic
Author

Need help on login frame in java.

Vivek Phogat
Greenhorn

Joined: Jan 11, 2011
Posts: 3
Can anyone help me? I need to enable login in following frame with username and password. I'm providing my code as.





[Thumbnail for Login.jpg]

Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2946
    
  15

Welcome to JavaRanch!

Please TellTheDetails UseCodeTags


Mohamed Sanaulla | My Blog
Vivek Phogat
Greenhorn

Joined: Jan 11, 2011
Posts: 3
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
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8566

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


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2946
    
  15

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

Joined: Jan 11, 2011
Posts: 3
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Need help on login frame in java.
 
Similar Threads
I got runtime error
Implementing scanner into a simple login page
ActonListener
How to add components to JFrame after coloring the JFrame
Problem while using prepared statement