Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 04:44 Go to next message
tweety tweet is currently offline tweety tweet
Messages: 1
Registered: May 2013
Junior Member
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 04:20 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3198
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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: Wed Oct 01 12:15:46 GMT 2014

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

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