PaletteHelper.java 文件源码

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

项目:passage 作者:
/**
 * Get a layer's associated palette as a top-level window
 * 
 * @param gui the Component to place in the window
 * @param cl the listener to associate with the palette
 * @return the frame that the palette is in
 */
public static JFrame getNoScrollPaletteWindow(Component gui,
                                              String windowName,
                                              ComponentListener cl) {

    JPanel pane = new JPanel();
    pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
    pane.setAlignmentX(Component.CENTER_ALIGNMENT);
    pane.setAlignmentY(Component.BOTTOM_ALIGNMENT);
    pane.add(gui);
    JFrame paletteWindow = new JFrame(windowName);
    paletteWindow.addComponentListener(cl);
    paletteWindow.getContentPane().add(pane);
    paletteWindow.pack();

    return paletteWindow;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号