PopupToolBar.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:WOLFGANG 作者:
/**
 * 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 tlb = getToolBar(alignment);
    if (tlb == null) {
        return null;
    }
    final JDialog dlg = new JDialog(JOptionPane.getFrameForComponent(comp));
    dlg.addMouseMotionListener(new MouseMotionAdapter() {

        public void mouseMoved(MouseEvent e) {
            if (!dlg.hasFocus())
                dlg.requestFocusInWindow();
        }

    });
    dlg.setUndecorated(true);
    dlg.setLayout(new BorderLayout());
    dlg.add(tlb);
    dlg.pack();

    Point loc = adujstPoint(point);
    SwingUtilities.convertPointToScreen(loc, comp);
    dlg.setLocation(loc);
    return dlg;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号