/**
* 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 getPaletteWindow(Component gui, String windowName,
ComponentListener cl) {
JScrollPane scrollPane = new JScrollPane(gui, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
scrollPane.setAlignmentY(Component.TOP_ALIGNMENT);
// create the palette internal window
JFrame paletteWindow = new JFrame(windowName);
paletteWindow.addComponentListener(cl);
paletteWindow.getContentPane().add(scrollPane);
//layout all the components
paletteWindow.pack();
return paletteWindow;
}
PaletteHelper.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:passage
作者:
评论列表
文章目录