Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103728344
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-05-10 11:17:42

作者: Laifus     出自:
发现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分钟搞定一个界面数据库的基本使用。
阅读(350) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~