PIXNET Logo登入

經驗交流分享與備忘

跳到主文

感情最痛恨 劈腿. 背叛 與 欺騙

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 12月 24 週一 201808:23
  • jquery disable form submit on enter

 
If keyCode is not caught, catch which:
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(37)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 11月 06 週二 201220:56
  • [JAVA] Initializing an ArrayList in a constructor with parameters

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?

Ans:
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(114)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 3月 20 週二 201211:45
  • [轉貼] focus & key board listner problem in cell table in gwt

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:
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(50)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 1月 11 週三 201215:42
  • [轉貼] GWT - Browser window resized handler

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:
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(100)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 1月 10 週二 201216:40
  • [轉貼] GWT/Firefox: getOffsetHeight() always returns 0

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

RootPanel panel = RootPanel.get();
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(47)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 12月 22 週四 201118:11
  • Java 日期 v.s 字串 互轉

Java 日期轉字串範列



1.//目前時間

2.Date date = new Date();

3.//設定日期格式

4.SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

5.//進行轉換

6.String dateString = sdf.format(date);

7.System.out.println(dateString);



Java字串轉日期範例



 



1.//欲轉換的日期字串

2.String dateString = "20010-03-02 20:25:58";

3.//設定日期格式

4.SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

5.//進行轉換

6.Date date = sdf.parse(dateString);

7.System.out.println(date);





以上不支援 gwt, 若要在 gwt 字串日期互轉, 必須使用 

DateTimeFormat


原因為:

 

GWT Doesnt support this java APi. It's explicit in documentation pages 


GWT does not provide full emulation for the date and number formatting 
classes (java.text.DateFormat, java.text.DecimalFormat, 
java.text.NumberFormat, java.TimeFormat, et cetera). Instead, a subset 
of the functionality of the JRE classes is provided by 
com.google.gwt.i18n.client.NumberFormat and 
com.google.gwt.i18n.client.DateTimeFormat 


GWT provides the DateTimeFormat class to replace the functionality of 
the DateFormat and TimeFormat classes from the JRE.


詳細用法, 請參考 http://code.google.com/intl/fr/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideDateAndNumberFormat 


參考資料: GWT官方文件 and http://cooking-java.blogspot.com/2010/03/java-string-to-date.html 





(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(5,848)

  • 個人分類:JAVAt程式設計-GWT
▲top
  • 12月 19 週一 201120:21
  • [轉帖] Using GWT 1.6’s DatePicker Widget as PopUp

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.
(繼續閱讀...)
文章標籤

本熊 發表在 痞客邦 留言(0) 人氣(121)

  • 個人分類:JAVAt程式設計-GWT
▲top
1

參觀人氣

  • 本日人氣:
  • 累積人氣:

文章分類

toggle 作業系統相關 (9)
  • FreeBSD (8)
  • IPv6 Logo (2)
  • Visual C# (1)
  • Visual C# (1)
  • Mac使用心得 (5)
  • Synology NAS應用 (0)
  • 系統應用 (49)
  • 防毒防駭 (5)
  • 系統安裝 (30)
toggle 投資理財 (2)
  • 科技產業 (8)
  • 投資學習 (9)
toggle 網頁設計相關 (6)
  • Flex程式設計 (5)
  • MySQL資料庫 (13)
  • ASP.NET程式設計 (1)
  • CSS樣式表應用 (5)
  • Flex (1)
  • PHP程式設計 (51)
  • Perl 程式設計 (1)
  • Windows系統應用 (2)
  • 好書推件 (1)
  • Android程式設計 (10)
  • C程式設計 (2)
  • Linux相關應用 (18)
  • Java程式設計 (6)
  • JAVAt程式設計-GWT (7)
  • Eucalyptus XEN (2)
  • 喻道故事 (1)
  • 下載資源 (2)
  • 終生學習 (7)
  • Goolge 新玩意 (1)
  • 英文學習心得 (3)
  • 工商服務 (12)
  • 勵志成長 (18)
  • 新聞時事 (17)
  • 讀者服務 (3)
  • JavaScript (22)
  • 省錢大作戰 (15)
  • 搶錢大作戰 (2)
  • 趣味分享 (50)
  • 感情生活 (15)
  • 用DSLR寫日記 (20)
  • 程式設計 (7)
  • 職場人生 (16)
  • 健康生活 (63)
  • 未分類文章 (1)