將組件設置爲容器中的引導組件時,將永遠不調用其longPointerPress()
方法。永遠不會在引導組件上調用longPointerPress()
請看下面的例子:
final Button lead = new Button("Lead") {
@Override
public void longPointerPress(int x, int y) {
super.longPointerPress(x, y);
// Never invoked!!!
Dialog.show("", "Long pointer press at (" + x + "," + y + ")", "OK", null);
}};
// --------------------------------
// | Label | Lead | Another label |
// --------------------------------
final Container c = BoxLayout.encloseX(new Label("Label"), lead, new Label("Another label"));
c.setLeadComponent(lead);
的longPointerPress()
是永遠不會被調用。但是,如果我設置c.setLeadComponent(null)
,則會調用長按。但是,我忽略了主要部分的概念。
這是一個錯誤?如果沒有,我怎麼才能意識到我想要做什麼?
感謝您的建議。不過,我想我早些時候嘗試過,並沒有奏效。 – sidiabale