package visible;

import nextapp.echo.app.ApplicationInstance;
import nextapp.echo.app.ContentPane;
import nextapp.echo.app.Label;
import nextapp.echo.app.Window;
import nextapp.echo.app.*;


import nextapp.echo.app.event.ActionListener;
import nextapp.echo.app.event.ActionEvent;

public class VisibilityApp extends ApplicationInstance {
		private TextField text;

public Window init() {
        Window window = new Window();
		window.setTitle("Components Visibility");
		ContentPane contentPane = new ContentPane();
		text=new TextField();
		text.setText("Welcome to RoseIndia!");
		Grid grid=new Grid();
		grid.add(text);
		Button buttonFalse = new Button("Visible=False");
		buttonFalse.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e)
            {
			text.setVisible(false);
            }  
        });
		grid.add(buttonFalse);
		Button buttonTrue = new Button("Visible=True");
		buttonTrue.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e)
            {
			text.setVisible(true);
            }  
        });
		grid.add(buttonTrue);
		contentPane.add(grid);
		window.setContent(contentPane);
        return window;
    }	
} 