3
我在獲取工具欄的高度時遇到了問題。Codenmae一個工具欄高度
添加組件之前,高度爲「0」,添加組件後結果相同。
那麼,有沒有辦法獲得真正的工具欄高度?
btnCnt = new Container();
btnCnt.setUIID(null);
btnCnt.addComponent(btnBack);
btnCnt.addComponent(btnHome);
btnCnt.addComponent(btnExit);
currentForm.setToolBar(homeToolBar);
currentForm.addCommand(SideLogoCommand);
homeToolBar.addCommandToSideMenu(MenuCommand);
homeToolBar.setTitleComponent(btnLogo);
Container commandCnt = new Container(new BorderLayout());
commandCnt.addComponent(BorderLayout.EAST, btnCnt);
commandCnt.setUIID(null);
commandCnt.setPreferredH(homeToolBar.getHeight());
stateMachine.findCntHomeV2Header(currentForm).removeAll();
stateMachine.findCntHomeV2Header(currentForm).repaint();
stateMachine.findCntHomeV2Header(currentForm).addComponent(commandCnt);
感謝@Diamond – Adnane17