第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用 MigLayout 將 JLabel 添加到 JPanel 時(shí)出現(xiàn)類轉(zhuǎn)換異常

使用 MigLayout 將 JLabel 添加到 JPanel 時(shí)出現(xiàn)類轉(zhuǎn)換異常

ibeautiful 2023-07-13 14:32:48
我有以下代碼:JPanel panel = new JPanel(new MigLayout());;JLabel label = new JLabel("Sample Label")panel.add(label, "gaptop 20, gapbottom 20,wrap");當(dāng)我查看MigLayout文檔時(shí),上面的代碼對(duì)我來(lái)說(shuō)看起來(lái)是有效的,但在運(yùn)行時(shí)它會(huì)拋出java.lang.ClassCastException異常,并帶有下面的堆棧跟蹤java.lang.ClassCastException: java.lang.String cannot be cast to net.miginfocom.layout.CC        at com.intellij.ui.layout.migLayout.patched.MigLayout.addLayoutComponent(MigLayout.kt:403)        at java.awt.Container.addImpl(Container.java:1128)        at java.awt.Container.add(Container.java:973)        at com.xxx.size.plugin.MemoryMeasurementTool_Tool.loadToolResultPanel(xxxMeasurementTool_Tool.java:58)        at com.xxx.size.plugin.MemoryAnalyzer$1.run(xxxAnalyzer.java:75)        at jetbrains.mps.smodel.WorkbenchModelAccess$UndoContextSetup.run(WorkbenchModelAccess.java:378)        at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:84)        at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:105)        at jetbrains.mps.smodel.ActionDispatcher.dispatch(ActionDispatcher.java:84)        at jetbrains.mps.smodel.ActionDispatcher.lambda$wrap$0(ActionDispatcher.java:105)        at jetbrains.mps.smodel.LockRunnable.run(LockRunnable.java:60)        at jetbrains.mps.smodel.TryRunPlatformWriteHelper.lambda$tryWrite$2(TryRunPlatformWriteHelper.java:122)        at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1057)        at jetbrains.mps.smodel.TryRunPlatformWriteHelper.runWrite(TryRunPlatformWriteHelper.java:103)        at jetbrains.mps.smodel.TryRunPlatformWriteHelper.tryWrite(TryRunPlatformWriteHelper.java:120)        at jetbrains.mps.smodel.WorkbenchModelAccess.lambda$tryWriteInCommand$4(WorkbenchModelAccess.java:226)        at jetbrains.mps.util.ComputeRunnable.compute(ComputeRunnable.java:32)        at jetbrains.mps.util.AbstractComputeRunnable.run(AbstractComputeRunnable.java:27)
查看完整描述

1 回答

?
一只萌萌小番薯

TA貢獻(xiàn)1795條經(jīng)驗(yàn) 獲得超7個(gè)贊

看起來(lái),您使用了錯(cuò)誤的導(dǎo)入(您使用由 Intellij Idea 修補(bǔ)的 MigLayout,該用法可能與標(biāo)準(zhǔn)用法不同)。檢查您的 MigLayout 是否導(dǎo)入為:

import net.miginfocom.swing.MigLayout;


查看完整回答
反對(duì) 回復(fù) 2023-07-13
  • 1 回答
  • 0 關(guān)注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)