방금 GWT로 시작했습니다. 튜토리얼을 here으로 지정했습니다. 그러나 새 프로젝트를 만들고 가로 패널에 두 개의 버튼을 추가 한 다음 RootPanel에서 HTML 파일에서 만든 머리글 만 표시했습니다. 이유가 무엇인지 말해 줄 수 있어요? 자바 클래스 : 다음은 자바 클래스는 HTML과 XML입니다새 GWT 앱의 버튼
package org.elsys.salvation.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
public class Salvation implements EntryPoint {
private Button newData = new Button("New");
private Button existingData = new Button("Existing");
private HorizontalPanel mainHorizontalPanel = new HorizontalPanel();
private Label lastUpdatedLabel = new Label();
public void onModuleLoad() {
mainHorizontalPanel.add(newData);
mainHorizontalPanel.add(existingData);
mainHorizontalPanel.add(lastUpdatedLabel);
RootPanel.get("Salvation").add(mainHorizontalPanel);
}
}
html로 :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="Salvation.css">
<title>Diploma Defences Organiser</title>
<script type="text/javascript" language="javascript" src="stockwatcher/stockwatcher.nocache.js"></script>
</head>
<body>
<h1>Diploma Defences Organiser</h1>
<div id="Salvation"></div>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
</body>
</html>
그리고 XML :
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Salvation'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='org.elsys.salvation.client.Salvation'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
어떻게 프로젝트를 시작 했습니까? 환경을 코딩 할 때 이클립스를 사용하고 있습니까? – Stefan
예, 일식 : – malkoto1