部落格文章訂閱


貧窮不能等,因為時間久了,你就會貧窮習慣了;
夢想不能等,因為努力晚了,人老就無能為力了;
學習不能等,因為懂得少了,就沒本事夢想成真了;
健康不能等,因為身體垮了,人生的一切就都沒了。


自訂搜尋

找不到想要的文章嗎? 請直接再下面的搜尋框裡輸入要查詢文章內容關鍵字 ,就能夠更快速的取得想要閱讀的問題喔~~謝謝大家的支持與愛護~若有任何建議事項, 歡迎透過留言板留言給我喔!!


  • 你不能決定生命的長度,但可以控制它的寬度;
  • 你不能左右天氣,但可以改變心情;
  • 你不能改變容顏,但可以展現笑容;
  • 你不能控制他人,但可以掌握自己;
  • 你不能預知明天,但可以利用今天;
  • 你不能樣樣勝利,但可以事事盡力。

free counters

目前分類:JAVAt程式設計-GWT (7)

瀏覽方式: 標題列表 簡短摘要

 

If keyCode is not caught, catch which:

$('#formid').on('keyup keypress', function(e) {
  var keyCode = e.keyCode || e.which;
  if (keyCode === 13) { 
    e.preventDefault();
    return false;
  }
});

EDIT: missed it, it's better to use keyup instead of keypress

EDIT 2: As in some newer versions of Firefox the form submission is not prevented, it's safer to add the keypress event to the form as well. Also it doesn't work (anymore?) by just binding the event to the form "name" but only to the form id. Therefore I made this more obvious by changing the code example appropriately.

EDIT 3: Changed bind() to on()

全文取自 https://stackoverflow.com/questions/11235622/jquery-disable-form-submit-on-enter 

 

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()

Just a quick question, how would you go about initializing a new ArrayList in a constructor which takes its values as parameters?

For example say I have a class which has an ArrayList of strings called bookings. I've already written a constructor which sets all fields to default values, so sets bookings to a new ArrayList of strings. However, the task I've been given is to write a second constructor which uses parameters to set the field values instead of setting them to defaults. This is fine for all my other fields, but how would I do this with the ArrayList?

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()

Question:

I have one small problem i.e. one textbox is their when click on the text box the popup is shows below the text box.The popup contains celltable

i write keypresslisner for textbox when i press Down And UP arrow the focus is set to be cellTable And also we still press down and up arrows its highlites the rows in celltable

Ans:

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()

Q:

I am developing a GWT application that render a text on a canvas. I want to resize the canvas whenever browser window resized. The problem is if I used Window.addResizeHandler, the rendering process with each resize will be very slow. So I need a way to resize the canvas only when the user release the mouse button after finishing resize. Is there anyway to do that?

A:

You could add a delay, so that the resize is only processed after the window hasn't been resized for some number of milliseconds:

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()

Q: Using GWT 1.6.4, I have the following code to retrieve the dimensions of the browser window:

RootPanel panel = RootPanel.get();

int height = panel.getOffsetHeight(); 

int width = panel.getOffsetWidth();

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()

Java 日期轉字串範列

1.//目前時間
2.Date date = new Date();
3.//設定日期格式

Frank 發表在 痞客邦 留言(0) 人氣()

I assumed the new date picker would entail also an edit field (based on readings in the corresponding wiki).

However this is not the case and you need to display it yourself on a panel. Ok admitted; it is better to have the flexibility to customize it yourself. For those – who like me are a bit rusty on their GWT – a sample piece of code of how to create a button with a popup panel containing the date picker and showing the date in a text box:

It is similar to the sample app that the webAppCreator cmd creates; it assumes an html with two elements defined.

##--CODE_START--##

文章標籤

Frank 發表在 痞客邦 留言(0) 人氣()