實作 tool tip 時,其實就是在介面上面放一個滑鼠停留的事件
當事件發生時,要求程式畫出一個文字欄位,把 tool tip 要顯示的東西放在欄位上。
範例的滑鼠停留事件可以參考 [1]。
Software entities (class, modules, functions, etc.) should be open for extension, but closed for modification.
- Bertrand Meyer
Junior programmers create simple solutions to simple problems. Senior programmers create complex solutions to complex problems. Great programmers find simple solutions to complex problems.
- Charles Connell
註1:本部落格的範例程式碼在 2015 年以前的文章中,大多是以全型空白做縮排。如需服用,請自行用文字編輯器的取代功能把全型空白取代成半型空白。
註2:本部落格的內容授權請參閱部落格底部的授權宣告。
2013年2月28日 星期四
2013年2月26日 星期二
(書籤) eclipse swt 相關教學與資源
各種元件的外觀:
1、SWT Examples in Clojure
教學文件:
1、Java SWT tutorial
2、SWT Tutorial by Lars Vogel
3、Eclipse中用SWT和JFace開發入門 (感覺是機器翻譯的文章)
4、SWT 學習簡介
1、SWT Examples in Clojure
教學文件:
1、Java SWT tutorial
2、SWT Tutorial by Lars Vogel
3、Eclipse中用SWT和JFace開發入門 (感覺是機器翻譯的文章)
4、SWT 學習簡介
2013年2月25日 星期一
在 OpenJDK 上使用 JavaMail 的問題
目前還在尋找問題中。
已經發現的問題是 JavaMail 在建立 Socket 連線時會噴以下的 Exception:
已經發現的問題是 JavaMail 在建立 Socket 連線時會噴以下的 Exception:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465 ; nested exception is: java.io.IOException: Can't create MailSSLSocketFactory at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java: 1966 ) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java: 654 ) at javax.mail.Service.connect(Service.java: 295 ) at javax.mail.Service.connect(Service.java: 176 ) at org.twgogo.jimwayne.mail.MailService.sendMail(MailService.java: 266 ) at org.twgogo.jimwayne.mail.MailService.sendMail(MailService.java: 157 ) at org.twgogo.jimwayne.main.Main.sendMail(Main.java: 52 ) at org.twgogo.jimwayne.main.Main.main(Main.java: 23 ) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 57 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 43 ) at java.lang.reflect.Method.invoke(Method.java: 616 ) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java: 58 ) Caused by: java.io.IOException: Can't create MailSSLSocketFactory at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java: 344 ) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java: 239 ) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java: 1929 ) ... 12 more Caused by: java.security.KeyStoreException: problem accessing trust storejava.io.EOFException at sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java: 75 ) at javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java: 247 ) at com.sun.mail.util.MailSSLSocketFactory$MailTrustManager.<init>(MailSSLSocketFactory.java: 333 ) at com.sun.mail.util.MailSSLSocketFactory$MailTrustManager.<init>(MailSSLSocketFactory.java: 331 ) at com.sun.mail.util.MailSSLSocketFactory.<init>(MailSSLSocketFactory.java: 115 ) at com.sun.mail.util.MailSSLSocketFactory.<init>(MailSSLSocketFactory.java: 94 ) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java: 337 ) ... 14 more |
no object DCH for MIME type multipart/mixed
在嘗試把寄信的程式寫成獨立的 Java 應用程式時,遇到以下的 Exception:
Google 了一下,雖然還蠻快找到解法,不過還不是非常了解這個問題的原因
可能是系統沒有預設告訴 JavaMail 要如何處理特定的 MIME 格式吧。
1 2 3 |
javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; |
Google 了一下,雖然還蠻快找到解法,不過還不是非常了解這個問題的原因
可能是系統沒有預設告訴 JavaMail 要如何處理特定的 MIME 格式吧。
2013年2月23日 星期六
2013年2月22日 星期五
(暫存) PBE AlgorithmParameters not available
暫存一些可能有點關連的連結,但目前尚未找到解法。
發生的原因好像是 JVM 找不到對應的 class 的樣子。
參考連結:
1、SSL socket & Framework version support problems
2、Certificate for Sourcefire e Streamer Collector fails with errors on the e Streamer certificate
發生的原因好像是 JVM 找不到對應的 class 的樣子。
參考連結:
1、SSL socket & Framework version support problems
2、Certificate for Sourcefire e Streamer Collector fails with errors on the e Streamer certificate
2013年2月21日 星期四
TP-LINK TL-WR1043ND 刷機
第一次嘗試要將分享器刷成第三方韌體,其實還蠻簡單的!XD
教學可以參考 [1],其實沒什麼特別的步驟
就去 dd-wrt 官方的 FTP 上找到要裝的韌體,然後下載「factory-to-ddwrt.bin」
檔名很明顯可以看出,這個檔案就是專門用來把分享器從原廠刷成 dd-wrt 用的。
其中在官方的 FTP 上,每個版本的韌體點進去都可以看到一大堆支援的分享器的資料夾
找到自己的分享器後,就可以下載到對應自己分享器的韌體了。
教學可以參考 [1],其實沒什麼特別的步驟
就去 dd-wrt 官方的 FTP 上找到要裝的韌體,然後下載「factory-to-ddwrt.bin」
檔名很明顯可以看出,這個檔案就是專門用來把分享器從原廠刷成 dd-wrt 用的。
其中在官方的 FTP 上,每個版本的韌體點進去都可以看到一大堆支援的分享器的資料夾
找到自己的分享器後,就可以下載到對應自己分享器的韌體了。
2013年2月6日 星期三
2013年2月4日 星期一
Same origin policy
依據 Wikipedia [1] 上對於 Same origin policy 的描述如下:
In computing, the same origin policy is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site – a combination of scheme, hostname, and port number[1] – to access each other's methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites.
訂閱:
文章 (Atom)