Project

General

Profile

Support #2243

Do NOT display image

Added by Anonymous about 9 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Target version:
-
Start date:
09/20/2013
Due date:
% Done:

0%

Estimated time:

Description

I download the hello programme from http://www.webtoolkit.eu/jwt/examples/ , and changed it . But the image is NOT displayed.

How to display the image? Please help me.

The HelloMain.java source:

public class HelloMain extends WtServlet {

private static final long serialVersionUID = 1L;

public HelloMain() {

super();

}

@Override

public WApplication createApplication(WEnvironment env) {

/*

  • You could read information from the environment to decide whether the
  • user has permission to start a new application
    */
    return new HelloApplication(env);
    }
    }

//------------------------------------------------------------------

The HelloApplication.java source

public class HelloApplication extends WApplication {

public HelloApplication(WEnvironment env) {

super(env);

getRoot().addWidget(new WImage(new WLink("icons/wt_powered.jpg")));

getRoot().addWidget(new WText("yeah Your name, please ---0po0 ? "));

final WLineEdit nameEdit = new WLineEdit(getRoot());

nameEdit.setFocus();

WAnchor anchor = new WAnchor(new WLink(http://www.webtoolkit.eu/"), "Wt");

anchor.setTarget(AnchorTarget.TargetNewWindow);

WImage image = new WImage(new WLink("icons/emweb.jpg"), anchor);

getRoot().addWidget(image);

WPushButton button = new WPushButton("yeah Greet me.", getRoot());

button.setMargin(5, Side.Left);

getRoot().addWidget(new WBreak());

final WText greeting = new WText(getRoot());

button.clicked().addListener(this, new Signal.Listener() {

public void trigger() {

greeting.setText("yeah Hello many many there, " + nameEdit.getText());

}

});

}

}

Also available in: Atom PDF