🎶 Sym - 一款用 Java 实现的现代化社区(论坛/BBS/社交网络/博客)平台

📕 思源笔记 - 一款桌面端笔记应用,支持 Windows、Mac 和 Linux

🎸 Solo - B3log 分布式社区的博客端节点,欢迎加入下一代社区网络

♏ Vditor - 一款浏览器端的 Markdown 编辑器

ubuntu 上 netbeans6.1 在 desktop application 的小问题

发现netbeans真的好强大阿,可以建一个工程直接操作数据库,而且使用比较方便
这就是图片

首先新建工程,选则java- desktop application
然后next,再在choose application shell中选择database application
再next
最后在master connection选择new database connection
我使用的是MySQL,所以要选择MySQL,
然后填写一下URL jdbc:mysql://localhost:3306/database_name
和user name,password
最后finish,run就ok了
很爽阿,可是在ubuntu上,我没有使用系统默认的皮肤,于是就产生这样的bug
run:
2008-5-8 14:44:51 org.jdesktop.application.Application create
警告: Couldn't set LookandFeel Application.lookAndFeel = "system"
java.lang.NullPointerException
        at javax.swing.plaf.synth.SynthLookAndFeel$AATextListener.propertyChange(SynthLookAndFeel.java:793)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
        at java.awt.Toolkit.setDesktopProperty(Toolkit.java:1784)
        at sun.awt.SunToolkit.fireDesktopFontPropertyChanges(SunToolkit.java:1698)
        at sun.awt.SunToolkit.setAAFontSettingsCondition(SunToolkit.java:1743)
        at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:119)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initComponentDefaults(GTKLookAndFeel.java:1258)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getDefaults(GTKLookAndFeel.java:294)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:581)
        at org.jdesktop.application.Application.create(Application.java:249)
        at org.jdesktop.application.Application$1.run(Application.java:169)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
2008-5-8 14:44:51 org.jdesktop.application.Application$1 run
严重: Application class dbinout.DBInOutApp failed to launch
java.lang.NullPointerException
。。。。。。

于是乎你要在属性中的desktop app中的look&feel中选择java default,这样就ok了。。。
嘻嘻,2分钟搞定一个界面数据库的基本使用。。。








欢迎注册黑客派社区,开启你的博客之旅。让学习和分享成为一种习惯!

留下你的脚步