热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

GWT 面试题与答案

问题 16. What are the GWT Panels?

RootPanel is the top level panel.

For layout the page, we could use following layout panels, finally we need to add all those layout panels in RootPanel.

DockLayoutPanel
SplitLayoutPanel
StackLayoutPanel
TabLayoutPanel

Use below panels inside the Layout panels for holding the widgets.

HorizontalPanel
VerticalPanel ( Prefer using FlowPanel )

这有帮助吗? 添加评论 查看评论
 

问题 17. How to create custom widgets in GWT?

Create a class that should extends Composite class of GWT.
Inside the constructor you can write you logic to create a widget and call the initWidget method().
Then you can use this class in anywhere in the application and add this widget in any panels.

private static class OptionalTextBox extends Composite implements
ClickHandler {
private TextBox textBox = new TextBox();
private CheckBox checkBox = new CheckBox();
--------
initWidget(panel);
-------
}

这有帮助吗? 添加评论 查看评论
 

问题 18. Code of entry point with onModuleLoad where split out is working.

To split your code, simply insert calls to the method GWT.runAsync at the places where you want the program to be able to pause for downloading more code. These locations are called split points. For this you should use runAsync.

public class Hello implements EntryPoint {
public void onModuleLoad() {
Button b = new Button("Click me", new ClickHandler() {
public void onClick(ClickEvent event) {
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable caught) {
Window.alert("Code download failed");
}

public void onSuccess() {
Window.alert("Hello, AJAX");
}
});
}
});

RootPanel.get().add(b);
}
}

这有帮助吗? 添加评论 查看评论
 

问题 19. What is AsyncDataProvider in GWT cell widgets?

When you want to display dynamic data or a range of data, not just a static list, then we should use AsyncDataProvider.

这有帮助吗? 添加评论 查看评论
 

问题 20. What is GWT ClientBundle?

In GWT we can use ClientBundle to load all the images and CSS files in one single file and use it anywhere in the application. It provides flexible way to get the resources.

1. It creates a single image from the collection of images at compile time to reduce the image size.
2. Enable more aggressive caching headers for program resources. It will go to server for every-time to get the images.
3.Eliminate mismatches between physical file names and constants in Java code by performing consistency checks during the compile.

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。