/**
* 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;
}
PaletteHelper.java 文件源码
java
阅读 39
收藏 0
点赞 0
评论 0
项目:passage
作者:
评论列表
文章目录