Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9260009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:47:28+00:00 2026-06-18T12:47:28+00:00

I wanna want to pass or share data(values) from login frame to all frames

  • 0

I wanna want to pass or share data(values) from login frame to all frames in my project, H have made class of this variables like this

public class SharedData {

    public  String LoginName;

    public SharedData() {
    }

    /**
     * @return the LoginName
     */
    public String getLoginName() {
        return LoginName;
    }

    /**
     * @param LoginName the LoginName to set
     */
    public void setLoginName(String LoginName) {
        this.LoginName = LoginName;
    }
}

and from the first frame (login frame) I make object of this class and sets its username like this

 public  SharedData  data1=new SharedData();
    data1.setLoginName(Username_Login.getText().toString());

and from the second frame i get the value :

public  SharedData  data=new SharedData();
ogin_labelName.setText(data1.getLoginName().toString());

But finally it doesn’t work … what is the problem or any solution ?

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:47:29+00:00Added an answer on June 18, 2026 at 12:47 pm

    You can create a bean class like :

    public class SharedData {
            public  static String LoginName;
    
            public static void setLoginName(String LoginName) {
                SharedData.LoginName = LoginName;
            }
    
            public static String getLoginName() {
                return LoginName;
            }
        }
    

    And use this class for setting and getting a values from another form just calling this class for setting a value:

    SharedData.setLoginName(Username_Login.getText().toString());
    

    and for getting a value :

    ogin_labelName.setText(SharedData.getLoginName(Username_Login.getText().toString()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to split my views project into sereveral modules. i wanna have a
I have a something that I want to encrypt and pass it via get
I have class: @custom_decorator class Creature(objects): def __init__(self): pass def rise_hands(self, *args, **kwargs): print
I want to capture all posted data in one single line like name=asd&age=12&city=something and
I have two tables user and treeview . From my registration form I wanna
I want to display all records from database in gridview when pageload and also
I have a rectangle which want to move using Canvas.SetLeft(rect, x); But I wanna
I wanna use a CheckBox but I want it to have the RadioButton chrome.
I want add my page some div and another tags.I wanna give unique class
I want to upload data from Google Cloud Storage to BigQuery, but I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.