在基于日志的两种不同情况下,我使用签名组件看到“索引超出范围”异常。我无法在模拟器中重现该问题。这是一个已知问题。请告知ID,没有任何解决方法。
代码:
canvas {
width: 2500px;
}
[EDT] 1:5:7,914-异常:java.lang.IndexOutOfBoundsException-第一段必须移动到
SignatureComponent signC = new SignatureComponent();
signC.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Image sourceImage = sign.getSignatureImage().scaledSmallerRatio(300, 100);
Image mute = Image.createImage(sourceImage.getWidth(), sourceImage.getHeight(), 0xffffffff);
Graphics g = mute.getGraphics();
g.setAntiAliased(true);
g.drawImage(sourceImage, 0, 0);
act.setSignature(mute);
}
});
[EDT] 1:5:7,926-异常:java.lang.IndexOutOfBoundsException-第一段必须移至
java.lang.IndexOutOfBoundsException
at com_codename1_ui_geom_GeneralPath.checkBuf:619
at com_codename1_ui_geom_GeneralPath.lineTo:668
at com_codename1_components_SignatureComponent_SignatureDialogBody_SignaturePanel.pointerDragged:488
at com_codename1_ui_Component.pointerDragged:4088
at com_codename1_ui_Form.pointerDragged:3355
at com_codename1_ui_Display.handleEvent:2288
at com_codename1_ui_Display.edtLoopImpl:1212
at com_codename1_ui_Display.invokeAndBlock:1355
at com_codename1_ui_Display.invokeAndBlock:1392
at com_codename1_ui_Form.showModal:2308
at com_codename1_ui_Dialog.showModal:1138
at com_codename1_ui_Dialog.show:582
at com_codename1_ui_Dialog.showPackedImpl:1434
at com_codename1_ui_Dialog.showPacked:1350
at com_codename1_ui_Dialog.showImpl:1094
at com_codename1_ui_Dialog.show:1072
at com_codename1_components_SignatureComponent_3.actionPerformed:229
at com_codename1_ui_util_EventDispatcher.fireActionEvent:349
at com_codename1_ui_Button.fireActionEvent:571
at com_codename1_ui_Button.released:605
at com_codename1_ui_Button.pointerReleased:709
at com_codename1_ui_Form.pointerReleased:3503
at com_codename1_ui_Component.pointerReleased:4621
at com_codename1_ui_Display.handleEvent:2249
at com_codename1_ui_Display.edtLoopImpl:1212
at com_codename1_ui_Display.mainEDTLoop:1130
at com_codename1_ui_RunnableWrapper.run:120
at com_codename1_impl_CodenameOneThread.run:176
at java_lang_Thread.runImpl:153
答案 0 :(得分:0)
这似乎是SignatureComponent
中的错误,我在此处添加了一种解决方法:https://github.com/codenameone/CodenameOne/commit/f402d1b27ade9560cd55db1a104f52e004fe1768
此更改将在今天的更新中。