标签:
//设置控件隐藏 tbButton.setVisible(false); InputMap inputMap = this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK), "VK_M"); ActionMap actionMap = this.getActionMap(); actionMap.put("VK_M", new AbstractAction() { boolean isVisible = false;//显示 @Override public void actionPerformed(ActionEvent e) { isVisible = !isVisible; tbButton.setVisible(!isVisible); } });
标签:
原文地址:http://www.cnblogs.com/kepengcheng/p/4552744.html