Skip to main content



      Home
Home » Newcomers » Newcomers » display list of some words by clicking a button(button click list few words)
display list of some words by clicking a button [message #1053192] Fri, 03 May 2013 00:44 Go to next message
Eclipse UserFriend
Hi,
I am new to eclipse. Now i've created a simple project using eclipse.By clicking the button the word is viewed.

Like if my button is CLICK ME and my word is hello welcum.
By clicking the button the "hello welcum" is viewed.

But now i'm trying to view more than a word.
Like
"hello welcum"
"have a nice day"
"hai"
Like this i want to do.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
      
        //Creating Button variable
        Button button = (Button) findViewById(R.id.bt);     
      
       //Adding Listener to button
         button.setOnClickListener(new View.OnClickListener() {
          
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
              
                //Creating TextView Variable
                TextView text = (TextView) findViewById(R.id.tv);
              
                //Sets the new text to TextView (runtime click event)
                text.setText("hello welcum");
                
            }
            
        });
  
    }

The above is my sample code. Please help me how to do.
Re: display list of some words by clicking a button [message #1053334 is a reply to message #1053192] Sat, 04 May 2013 00:20 Go to previous message
Eclipse UserFriend
On 05/03/2013 06:39 AM, tweety tweet wrote:
> Hi,
> I am new to eclipse. Now i've created a simple project using eclipse.By
> clicking the button the word is viewed.
>
> [snip]

Please read sticky posts at top of forum.
Previous Topic:Unable to export Juno (4.2) Product
Next Topic:Import repository from sourceforge.net
Goto Forum:
  


Current Time: Mon Jul 14 08:09:37 EDT 2025

Powered by FUDForum. Page generated in 0.10832 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top