/**
* Create the Window for the given alignment and
*
* @param comp
* father component
* @param alignment
* algenment
* @param point
* location point
* @return the created window
*/
protected Window createWindow(Component comp, int alignment, Point point) {
JToolBar bar = getToolBar(alignment);
if (bar == null) {
return null;
}
final JDialog dialog = new JDialog(JOptionPane.getFrameForComponent(comp));
dialog.addMouseMotionListener(new MouseMotionAdapter() {
public void mouseMoved(MouseEvent e) {
if (!dialog.hasFocus())
dialog.requestFocusInWindow();
}
});
dialog.setUndecorated(true);
dialog.setLayout(new BorderLayout());
dialog.add(bar);
dialog.pack();
Point loc = adujstPoint(point);
SwingUtilities.convertPointToScreen(loc, comp);
dialog.setLocation(loc);
return dialog;
}
WorkbenchPopupToolBar.java 文件源码
java
阅读 47
收藏 0
点赞 0
评论 0
项目:SWAT20
作者:
评论列表
文章目录