我發現this project在獨立運行中工作得很好。然而,當我嘗試將其添加到JPanel在另一個項目(已經在完全相同的項目,但我自己的一個JFrame這樣做和工作得很好)這個錯誤出現了:UIDefaults.getUI()失敗:將JFrame加載到另一個項目時出錯
UIDefaults.getUI() failed: no ComponentUI class for: doubleslider.MThumbSlider[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,isInverted=false,majorTickSpacing=0,minorTickSpacing=0,orientation=HORIZONTAL,paintLabels=false,paintTicks=false,paintTrack=true,snapToTicks=false,snapToValue=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(UIDefaults.java:729)
at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:130)
at javax.swing.UIDefaults.getUI(UIDefaults.java:759)
at javax.swing.UIManager.getUI(UIManager.java:1002)
at javax.swing.JSlider.updateUI(JSlider.java:323)
at doubleslider.MThumbSlider.updateUI(MThumbSlider.java:44)
at javax.swing.JSlider.<init>(JSlider.java:275)
at javax.swing.JSlider.<init>(JSlider.java:182)
at doubleslider.MThumbSlider.<init>(MThumbSlider.java:24)
at doubleslider.DoubleSlider.<init>(DoubleSlider.java:29)
at com.einge.scadaremotecontrol.Ventana.<init>(Ventana.java:227)
at com.einge.scadaremotecontrol.ScadaRemoteControl.<init>(ScadaRemoteControl.java:92)
at com.einge.scadaremotecontrol.ScadaRemoteControl.main(ScadaRemoteControl.java:197)
UIDefaults.getUI() failed: no ComponentUI class for: doubleslider.MThumbSlider[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,isInverted=false,majorTickSpacing=0,minorTickSpacing=0,orientation=HORIZONTAL,paintLabels=false,paintTicks=false,paintTrack=true,snapToTicks=false,snapToValue=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(UIDefaults.java:729)
at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:130)
at javax.swing.UIDefaults.getUI(UIDefaults.java:759)
at javax.swing.UIManager.getUI(UIManager.java:1002)
at javax.swing.JSlider.updateUI(JSlider.java:323)
at doubleslider.MThumbSlider.updateUI(MThumbSlider.java:44)
at doubleslider.MThumbSlider.<init>(MThumbSlider.java:26)
at doubleslider.DoubleSlider.<init>(DoubleSlider.java:29)
at com.einge.scadaremotecontrol.Ventana.<init>(Ventana.java:227)
at com.einge.scadaremotecontrol.ScadaRemoteControl.<init>(ScadaRemoteControl.java:92)
at com.einge.scadaremotecontrol.ScadaRemoteControl.main(ScadaRemoteControl.java:197)
我的第一個猜測是, MultiTumbSlider類試圖設置一個不同的Look &感覺比我的JFrame。任何解決方案我無法弄清楚這一點,我真的需要兩個滑塊所以有一個時間範圍
任何幫助將是appartiated!
你使用什麼外觀和感覺? – MadProgrammer 2012-07-16 18:19:32
@trashgod,我將工作項目導入爲jar文件,因此不會出現任何包裝問題。 – rMaero 2012-07-17 11:13:54
@MadProgrammer我正在使用Windows L&F,我懷疑MThumbSlider項目正在使用一些「Metal」L&F – rMaero 2012-07-17 11:16:49