Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Simple Login system - trying to set a jlabel

  1. #1
    Junior Member
    Join Date
    Apr 2020
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Simple Login system - trying to set a jlabel

    --- Update ---

    [/COLOR]Nevermind. ugh. Thanks I see it it was in the wrong spot. Out of scope.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Simple Login system - trying to set a jlabel

    method in the UserView where I want the username displayed:
    Where is the JLabel: lblUser added to a GUI component so it will be displayed?

    if (x == true
    Two things wrong with that code:
    variable names should describe what the variable contains. X does not do that. Better would be: goodLogin
    Do not compare the contents of a boolean variable.
    Use just a reference to the variable:
       if(goodLogin)

    public static void getUserName(String username) {
    The above method is named incorrectly. a get method should return a value. a set method takes a value and stores it.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2020
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Simple Login system - trying to set a jlabel

    OK, thank you. I still have a lot to learn. -_-

Similar Threads

  1. Printer Access Login System
    By himanshudwd144 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 23rd, 2014, 02:54 AM
  2. [SOLVED] User Login System Program.
    By AnkitAgarwal in forum What's Wrong With My Code?
    Replies: 6
    Last Post: December 8th, 2013, 11:27 PM
  3. Creating a Login System
    By NickP in forum Android Development
    Replies: 0
    Last Post: September 2nd, 2013, 07:35 AM
  4. Login system no access solution help
    By nickthegreek in forum Java Theory & Questions
    Replies: 2
    Last Post: May 19th, 2013, 06:20 PM
  5. How do I implement a login system in java using arrays
    By Leprechaun_hunter in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 21st, 2011, 08:03 AM