private void createAndShowUI() throws Exception {
frame = new JFrame();
frame.setTitle("Test Frame");
frame.setSize(800, 600);
JDesktopPane pane = new JDesktopPane();
TestInternalFrameWPopup testInternalFrame1 = new TestInternalFrameWPopup();
pane.add(testInternalFrame1);
testInternalFrame1.setVisible(true);
JScrollPane scrollPane = new JScrollPane(pane);
frame.getContentPane().add(scrollPane);
testInternalFrame1.setMaximum(true);
frame.getRootPane().registerKeyboardAction(e -> {
TestInternalFrame testInternalFrame2 = new TestInternalFrame();
pane.add(testInternalFrame2);
try {
testInternalFrame2.setMaximum(true);
} catch (PropertyVetoException ex) {
throw new RuntimeException(ex);
}
testInternalFrame2.setVisible(true);
}, KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
frame.setVisible(true);
}
TestPopupMenu.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:openjdk-jdk10
作者:
评论列表
文章目录