Skip to content

Instantly share code, notes, and snippets.

@iporsut
Created October 25, 2011 16:12
Show Gist options
  • Save iporsut/1313295 to your computer and use it in GitHub Desktop.
Save iporsut/1313295 to your computer and use it in GitHub Desktop.
Login Project Meme'
h1 {
font-size: 2em;
font-weight: bold;
color: #777777;
margin: 40px 0px 70px;
text-align: center;
}
.sendButton {
display: block;
font-size: 16pt;
}
.gwt-DialogBox {
width: 400px;
}
.dialogVPanel {
margin: 5px;
}
.serverResponseLabelError {
color: red;
}
#closeButton {
margin: 15px 6px 6px;
}
#hBox1 {
margin: 200px auto;
width: 500px;
height: 300px;
border: 1px solid black;
padding: 25px;
}
#vPanel1 {
width: 250px;
}
#vPanel2 {
width: 250px;
}
#idBox,#passwordBox {
margin-bottom: 20px;
}
#loginButton {
margin-top: 20px;
}
<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype is not supported. -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="EDPComponent.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Web Application Starter Project</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="edpcomponent/edpcomponent.nocache.js"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic UI. -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<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>
package th.ac.sut.edp.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
public class EDPComponent implements EntryPoint {
public void onModuleLoad() {
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.getElement().setId("hBox1");
VerticalPanel vPanel1 = new VerticalPanel();
vPanel1.getElement().setId("vPanel1");
VerticalPanel vPanel2 = new VerticalPanel();
vPanel2.getElement().setId("vPanel2");
Label idlabel = new Label("ID");
Label passwordlabel = new Label("Password");
TextBox idbox = new TextBox();
idbox.getElement().setId("idBox");
PasswordTextBox passwordbox = new PasswordTextBox();
passwordbox.getElement().setId("passwordBox");
Button loginButton = new Button("Login");
loginButton.getElement().setId("loginButton");
CheckBox checkBox = new CheckBox("Remember me");
checkBox.getElement().setId("checkBox");
vPanel2.add(idlabel);
vPanel2.add(idbox);
vPanel2.add(passwordlabel);
vPanel2.add(passwordbox);
vPanel2.add(checkBox);
vPanel2.add(loginButton);
hPanel.add(vPanel1);
hPanel.add(vPanel2);
RootPanel.get().add(hPanel);
idbox.setFocus(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment