How to make a Login Page with JFrame

Hi,
I have a to make a login page and to check the user name and password
and also to check the user permission and then check the permission
for which group...he had acess...
like i had 3 tables...
user table, permission tabel , and access tabel.
so plz can any one help me out with some codes

Hi Ranjan,
Run this demo and if it is ok then we could move to tree view.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Frame1 extends JFrame {
private static final String text = "<html> <center><b><font size=+3>Central</font></b> <br><b><font size=+3>Manager</font></b></center> </html>";
JPanel jPanel1 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JLabel jLabel1 = new JLabel();
JPanel jPanel2 = new JPanel();
GridBagLayout gridBagLayout1 = new GridBagLayout();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JTextField loginTextField = new JTextField(20);
JPasswordField passwordTextField = new JPasswordField(20);
JPanel jPanel3 = new JPanel();
JButton exitButton = new JButton();
JButton enterButton = new JButton();
FlowLayout flowLayout1 = new FlowLayout();
public Frame1() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
private void login(ActionEvent e) {
String login = loginTextField.getText();
String password = new String(passwordTextField.getPassword());
//validate login and password here. validity will be done by sending login/password to the server
if (login.equals("ranjan") && password.equals("ranjan")) {
System.out.println("login successfull");
showTreeView();
} else {
JOptionPane.showMessageDialog(this,"Incorrect login or password","Error",JOptionPane.ERROR_MESSAGE);
loginTextField.setText("");
passwordTextField.setText("");
loginTextField.requestFocusInWindow();
private void showTreeView() {
getContentPane().removeAll();
TreeViewPanel treeview = new TreeViewPanel();
getContentPane().add(treeview);
getContentPane().validate();
private void exit(ActionEvent e) {
setVisible(false);
public static void main(String[] args) {
Frame1 f = new Frame1();
f.setLocation(200,200);
f.pack();
f.show();
private void jbInit() throws Exception {
jPanel1.setLayout(borderLayout1);
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText(text);
jPanel2.setLayout(gridBagLayout1);
jLabel2.setText("Password:");
jLabel3.setText("Login:");
exitButton.setText("Exit");
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
exit(e);
enterButton.setText("Enter");
enterButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
login(e);
jPanel3.setLayout(flowLayout1);
flowLayout1.setAlignment(FlowLayout.RIGHT);
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jLabel1, BorderLayout.NORTH);
jPanel1.add(jPanel2, BorderLayout.CENTER);
jPanel2.add(loginTextField, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 11, 0, 0), 0, 0));
jPanel2.add(jLabel2, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(11, 0, 0, 0), 0, 0));
jPanel2.add(passwordTextField, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(11, 11, 0, 0), 0, 0));
jPanel2.add(jLabel3, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
jPanel1.add(jPanel3, BorderLayout.SOUTH);
jPanel3.add(enterButton, null);
jPanel3.add(exitButton, null);
import java.awt.*;
import javax.swing.*;
public class TreeViewPanel extends JPanel {
BorderLayout borderLayout1 = new BorderLayout();
JScrollPane jScrollPane1 = new JScrollPane();
JTree tree = new JTree();
JPanel jPanel1 = new JPanel();
JButton jButton1 = new JButton();
public TreeViewPanel() {
try {
jbInit();
catch(Exception ex) {
ex.printStackTrace();
void jbInit() throws Exception {
this.setLayout(borderLayout1);
jButton1.setText("Manage Group");
this.add(jScrollPane1, BorderLayout.CENTER);
jScrollPane1.getViewport().add(tree, null);
this.add(jPanel1, BorderLayout.SOUTH);
jPanel1.add(jButton1, null);
}

Similar Messages

  • How to make Turnable PDF-Pages with flip effect

    Hi,
    can any one help me?
    How to make flipping the pages in a PDF file using Acrobat professional? And how to save as a PDF file and is it possible?
    Please advise me how to process this.
    Thanks & Regards,
    Sudhakar

    Some related information that may help.
    http://forums.adobe.com/thread/719674?tstart=0
    http://acrobatusers.com/content/page-turner-0
    Be well...

  • How to: create a Login page with data tags

    hi, how could i create a jsp login page using the data tags.. and how to associate it with the other jsp pages that should be displayed in case of the correct insertion of the password .

    http://technet.oracle.com:89/ubb/Forum2/HTML/006025.html

  • How to edit webvpn login page with 7.2 version in ASA5510?

    Dear guys,
    As a solution for business, I have deployed webvpn with 7.2 version in ASA5510(Version 8.0 cannot be used in this case). Could you share some experiences in customizating login page of webvpn manually(not use ASDM)? for example, if I want to add some system tips or links in login page, how to do?
    Appreciate your kindly help and suggestion.
    Best Regards,
    David Wu

    Customizing login page of webvpn with 7.2 version of ASA is easy to be done and the following Url contains the dcument for customizing the webvpn login page for ASA version 7.2:
    http://www.cisco.com/en/US/docs/security/asa/asa72/configuration/guide/webvpn.html#wp1031868
    This document contains the step-by-step procedure for customizing the login page.

  • How to make a Web Page with Labview?

    I have a Project: CONTROL A CAMERA OVER INTERNET (with Labview)
    i try to make a Web Page but it s very difficult for me.I have Labview 8.6 and Internet Toolkit.
    Why can i make a simple Web page?
    Why can i control the camera over Internet?
    Thanks...

    This thread is quite old but there is a new answer that might better suite your needs... So, for those who are looking for the answer, have a look at WebPager plugin for LabVIEW here: https://labicom.net/labdeveloper/WebPager/ . It will make much better job (in most cases) than Remote Panels and Web Services suggested above. The only difficulty I see in your request is a 'camera' word. With WebPager you'll be able to control it from the browser (without any plugins or similar things), but the video image itself will pose problems... Still, it can be tackled. 
    =========================
    Igor Titov, CLA
    WebPager - put LabVIEW front panels into the web page
    Labicom.net

  • My Macbook Pro is frozen on the login page with a white screen and only my login picture. How do I fix this? I can't turn it off and I closed it and let it charge but it's still not working.

    My Macbook Pro is frozen on the login page with a white screen and only my login picture. How do I fix this? I can't turn it off and I closed it and let it charge but it's still not working. It's only 3 months old and was working perfectly fine 30min before this happened.

    Hello Kierasully,
    I would start your troubleshooting with the article below for issues of not being able to log in to your Mac. Start with booting up in to Safe Boot as well as resetting PRAM on your Mac. If that does not work, then verify the hard drive with booting to the Recover HD and go to Disk Utility to verify it.
    Mac OS X: Gray screen appears during startup
    http://support.apple.com/en-us/ts2570
    Regards,
    -Norm G. 

  • How do I make a facebook page with a premade template? [was:help]

    how do I make a facebook page with a premade template i bought on etsy? I have asked this 10 times now In all diffrent section here. I guess I dont even know how to ask a question in photo shop?? I am very glad I am only on the trial. This is soooo NOT user friendly!

    Tip for a forum newbie: please use a descriptive subject header to post your query so we have some idea of what your question relates to.
    "Help" tells us nothing. Try "how do I make a facebook page with a premade template?"
    You've posted this question 3 times in 3 different forums but we've no idea which Adobe software you're using or where your template is from. There is a reply in the Photoshop forum asking for more information.
    http://forums.adobe.com/thread/1447416
    Please continue the discussion there.

  • How do i make flyers in Pages with pull out phone #'s?

    how do i make flyers in Pages with pull out phone #'s and Photos?

    Ask the experts:
    https://discussions.apple.com/community/iwork/pages

  • I was wondering if there is a tutorial on how to make a blog page in muse?

    I was wondering if there is a tutorial on how to make a blog page in muse? Any help will be appreciated.

    Hi
    You can integrate third party blog in your site or if you are using Business Catalyst , then you can go with BC blog modules on page.
    More Details :
    http://www.musegrid.com/blog/add-business-catalyst-blogs-to-your-adobe-muse-website
    http://www.muse-themes.com/blogs/news/7257782-creating-a-blog-in-adobe-muse-powered-by-nab ble
    Thanks,
    Sanjit

  • Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now ?

    Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now that they do not have the spry option?

    bbull2005 wrote:
    Preran, why wouldn't Dreamweaver include it's own menu/navigation bar widget?
    I can't answer on Preran's or Adobe's behalf, but I think you'll find at least part of the answer here: http://wiki.jqueryui.com/w/page/38666403/Menubar
    Adobe decided to discontinue development of Spry in August last year, and Dreamweaver CC made the switch to using jQuery UI widgets and effects. One reason for dropping Spry was that it failed to work correctly in some browsers. Judging from the fact that the jQuery UI menubar is now "on ice", creating a flyout menu that works reliably across all devices is proving more difficult than originally envisaged.
    Because all other widgets in Dreamweaver CC use jQuery UI, it's a reasonable assumption that Adobe hoped the jQuery UI menubar would be ready in time, but it wasn't.

  • Create a login page with NI Security Programmatic Login.vi

    Hi everyone,
    I'm trying to create a login page that inputs username and password of users, then authorize user information with the Domain Account Manager to recognize user identification.
    I google and see the NI Security Programmatic Login.vi can allow me to create a login page and it works. However, I got a problem is to redirect to other pages after authorizing. 
    NI Security Programmatic Login.vi only outputs some string to show the status of the authentication, it doesnt output boolean like true or fall.
    Does anyone has a solution to help me?
    Thank you.
    This is my screen shot:

    Thank you for suggesting me. I've done the checking task but I don't know how to call a subVi.
    As you can see in the images I post below, I have a login page with its diagram, and the main page that I want to show after logging in conrrectly.
    So should the main page is the subVi or the login page? And can you tell me how to show the main page after logging correctly?
    I also don't know how to refresh the page if logging information is incorrect. Do you have any solution?
    Thank you so much.

  • How link my Facebook's page with my web site?

    Hi!
    How link my Facebook's page with my web site and have a preview of facebook's page on my website builted with iweb?
    Regards
    Thanks a lot.

    I think it's the other way around. Sharing a webpage on Facebook.
    Here's how : http://myipad.atspace.com/size/Share.html
    But if you want your FB page embedded in an iWeb page then paste the <iframe> code in a HTML Snippet.
    <iframe src="http://url.to.file.html" frameborder="0" width="500" height="500" scrolling="no" allowTransparency="true"></iframe>
    Where SRC="" is the URL of your Facebook page. Change the numbers for witdh and height to make the FB page fit your webpage.

  • How to make my tab page shows all my applications?

    How to make my tab page shows all my applications?Please help me as fast as possible. Thx .
    Note: Please write as detail as possible because I am new to vb.Thx again.

    Hi,
     For a lack of info about what Applications you are talking about we can only guess at what you want to do. In my experience, this is the kind of question that ends up being a mile long with 15 different examples because nobody knows exactly what you
    are trying to do.
     With that said, maybe you can put a ListView in your TabPage and use the code i showed in the link below. If not then please explain exactly what you want to do.  8)
    How to make a screen that displays 'all apps'?
    If you say it can`t be done then i`ll try it

  • How to make a Cleaning Page

    I recently became the Owner of a HP LaserJet 3100 all in one Printer and installed the Software so it will run on Windows Xp.
    I am having trouble with the Printing being too light and there are no instructions on how to make a Cleaning Page for XP.
    Can Anyone help?
    Thanks.

    Please refrain from posting such posts, u need to check dev guide, previous threads. If you can't find related info in both, then post in this forum.This forum is for issue related to OAF and not to teach basics.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Use Exchange 2010 OWA Login Page with Exchange 2013

    We are planning on upgrading our exchange server from 2010 to 2013. We want to keep 2010 OWA login page with this upgrade. Partly due to educating users to new OWA interface and no plan to upgrade to office 2013 anytime soon.
    Questions:
    1. Do you or do you not recommend?
    2. Is it possible?
    3. How to keep 2010 OWA login page during and after migration to 2013 (instructions)?
    Thank you!

    Hi, EthenLEC
    I agree with Andy David.
    For additional information, we can change OWA 2013 back to OWA 2010 interface to use light version by the following steps.
    Log in to OWA 2013.
    Once logged in, click on the settings gear in the upper right corner, choose
    Display Settings.
    From the Display settings menu, choose Outlook Web App version, then check the box to use the light version.
    Sign out of OWA and sign back in. Now it has the OWA 2013 light version.
    Best Regards.

Maybe you are looking for

  • Tuning Oracle APPS 11i Start with

    Hi Hussain/Helios, I am new to Oracle APPS, and am working oracle apps 11i 11.5.10.2 with 10.2.5.0, the database and application was upgraded by previous dba. which left almost 3-4 months before. now my question is i want to have a performance tuning

  • Cant add any music to my

    i've been trying to add music files to my zen and i keep have data error or general error.

  • Looking for the appropriate spot to post my question....

    This Feedback about the Discussions forum is intended for questions about how to use Apple Discussions ......but not sure where this one should go: looking for info & advice as to what Mac configuration I should build/buy with a $2000 --> $2500 budge

  • Wierd, a series of probs.

    First of all, I can't sign in which I obliviously need. Second, I can't get my rented videos on my ipod! If you guys have any help for me it would be greatly appreciated!

  • Profit Center message display in MV45AFZZ

    In include MV45AFZZ  USEREXIT_SAVE_DOCUMENT_PREPARE I have added code to display information message if profit centre is initial/blank for any line item. Suppose there are 3 line items for a sales order with line item 20 & 30 having profit centers as