iifast

HomePage.java

Jun 4th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. // File Name : HomePage.java
  2.  
  3. package com.mycompany.myapp.gui;
  4. import com.codename1.ui.Form;
  5. import com.codename1.ui.Label;
  6. import  com.codename1.ui.layouts.BoxLayout;
  7.  
  8. /**
  9. *
  10. *@author mabt
  11. */
  12.  
  13. public class HomeForm  extends Form {
  14. Form current; //pour indiquer la destination du boutton "back".
  15.  
  16.     public HomeForm() {
  17.         current=this;
  18.            setTitle("Home");
  19.            setLayout(BoxLayout.y());
  20.          
  21.            add(new Label("Choose an option"));
  22.            Button btnAddTask = new Button("Add Task");
  23.            Button btnListTask = new Button("List Tasks");      
  24.            
  25.            btnAddTask.addActionListener(e-> new AddTaskForm().show());
  26.            btnListTasks.addActionListener(e-> new ListTasksForm().show());
  27.            addAll(btnAddTask,btnListTasks);
  28.     }
  29.  
  30. }
Add Comment
Please, Sign In to add comment