How to make web based a wordpad using gwt

gwt is one of the best ways to develop user frendly web applications this is my first project done using
gwt i want be able to put the complete code because its too long but i'll put a few useful codes

Creating a menuBar(this goes in the class that extends EntryPoint)
MenuBar menu = new MenuBar();

// Create the file menu
MenuBar fileMenu = new MenuBar(true);
menu.addItem(new MenuItem(constants.cwMenuBarFileCategory(), fileMenu));
String[] fileOptions = {"New","Open","Save","Save As","Print","Print Preview","Exit"};
for (int i = 0; i <fileOptions.length; i++) {
fileMenu.addItem(fileOptions[i], menuCommand);

// Create the edit menu
MenuBar editMenu = new MenuBar(true);
menu.addItem(new MenuItem(constants.cwMenuBarEditCategory(), editMenu));
String[] editOptions = {"Undo","Cut","Copy","Paste","SelcetAll","Clear"};
for (int i = 0; i <editOptions.length; i++) {
editMenu.addItem(editOptions[i], menuCommand);


Now menuCommand is were you put the coding for the action when the link is clicked you will have to useone for each here i only used one.first make another class

Command menuCommand = new Command() {

public void execute() {
Window.alert("you just clicked it");

public Command getMenuCommand() {
return menuCommand;

Using a dialogBox to insert Bullets into a text area and how to use popups to make it user frendly

Button bullets=new Button();
RichTextArea ta=new RichTextArea();
final DecoratedPopupPanel bulletpop=new DecoratedPopupPanel(true, false);
bullets.addMouseOverHandler(new MouseOverHandler() {

public void onMouseOver(MouseOverEvent event) {
int left = 620;
int top = 55;
bulletpop.setPopupPosition(left, top);

bulletpop.setWidget(new Label("bullets"));;

bullets.addMouseOutHandler(new MouseOutHandler() {

public void onMouseOut(MouseOutEvent event) {
bullets.addClickListener(new ClickListener() {

public void onClick(Widget sender) {


Popular posts from this blog

How to set up a Apache Spark cluster in your local machine

Writing Unit Tests to test JMS Queue listener code with ActiveMQ

Apache Hadoop MapReduce - Detailed word count example from scratch