List of usage examples for com.google.gwt.user.client.ui TextArea getCharacterWidth
public int getCharacterWidth()
From source file:com.example.GWTOAuthLoginDemo.client.GWTOAuthLoginDemo.java
License:Open Source License
public void log(String msg) { if (appScreen == null) { return;/*from w w w . j a v a2 s . c om*/ } TextArea logTextArea = appScreen.getTextArea(); Date d = new Date(); String t = d.toString() + ": " + msg; int cW = logTextArea.getCharacterWidth(); String currentText = logTextArea.getText(); if (currentText.length() > 0) { logTextArea.setText(currentText + "\n" + t); } else { logTextArea.setText(t); } appScreen.getScrollPanel().scrollToBottom(); Log.debug(msg); }